1
我陷入了解析文本区域中的回报的小问题。Convert Carrage返回到br标记
jQuery代码
$.fn.escapeHtml = function() {
this.each(function() {
$(this).html(
$(this).html()
.replace(/"/g,""")
.replace(/&/g,'&')
.replace(/</g,'<')
.replace(/>/g,'>')
.replace(/'/g,''')
// For converting carrage return (enter key) to br
.replace(/(\r\n|\r|\n)/g, '< br >')
.replace(/183/g,'·')
);
});
return $(this);
}
})(jQuery);
在Firefox它的工作原理,并给出了输出
<big>Heading</big><br>Test Line 1<br>Test Line 2<br>Test Line 3
在Internet Explorer中它不工作在所有..我如何在IE中解决这个问题。我intented输出等预先这个
<big>Heading</big><br>Test Line 1<br>Test Line 2<br>Test Line 3
谢谢...
- (...仍然不能在IE7中工作 – Sullan 2010-07-27 06:14:46