换行不在IE10中工作 [英] newline not working in IE10

查看:85
本文介绍了换行不在IE10中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的代码中,当我使用相同的比较或分割时,newline不适用于IE10。



  var  selText = selectedText.split(换行符); 
。 。 。 。
if ($ get(targetControlId)。 value .indexOf(newline + TrimText(storeKeywords) + > = 0







请帮助。

解决方案

get(targetControlId)。 value .indexOf(newline + TrimText(storeKeywords)+ > = 0







请帮忙。


首先,新行与平台有关: http://en.wikipedia.org/wiki/End_of_line [ ^ ]。







请参阅:

http://www.sitepoint.com/line-endings-in-javascript/ [ ^ ],

http://stackoverflow.com/questions/1155678/javascript-string-newline-character [ ^ ]。



[结束编辑]



更重要的是,新行适用于< textarea> 的文本值,但不适用于HTML,其中显示新行效果的最简单方法是元素< br />



-SA

In below code "newline" is not working for IE10 alone when I used the same to compare or split.

var selText = selectedText.split(newline);
. . . .
if ($get(targetControlId).value.indexOf(newline + TrimText(storeKeywords) + ".") >= 0)




Please help.

解决方案

get(targetControlId).value.indexOf(newline + TrimText(storeKeywords) + ".") >= 0)




Please help.


First, new line is platform-dependent: http://en.wikipedia.org/wiki/End_of_line[^].

[EDIT]

Please see:
http://www.sitepoint.com/line-endings-in-javascript/[^],
http://stackoverflow.com/questions/1155678/javascript-string-newline-character[^].

[END EDIT]

More importantly, new line is applicable to text value of <textarea>, but not HTML where the simplest way to show the effect of new line is the element <br/>.

—SA


这篇关于换行不在IE10中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆