js textarea 转码问题 从数据库读的时候在转比 要是有滚动条可能不能显示了吧要不加上style="width:100%;overflow-y:visible;" styleClass="input_off" readonly="true" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //自定义firefox的innerTextfunction isIE(){ //ie? if (window.navigator.userAgent.toLowerCase().indexOf("msie") >= 1) return true; else return false;}if (!isIE()){ //firefox innerText define HTMLElement.prototype.__defineGetter__("innerText", function() { var anyString = ""; var childS = this.childNodes; for (var i = 0; i < childS.length; i++) { if (childS[i].nodeType == 1) anyString += childS[i].tagName == "BR" ? '\n' : childS[i].innerText; else if (childS[i].nodeType == 3) anyString += childS[i].nodeValue; } return anyString; } ); HTMLElement.prototype.__defineSetter__("innerText", function(sText) { this.textContent = sText; } );}//html的解码WLControl.htmlDecode=function(html){ var div=document.createElement("div"); div.innerHTML=html; return div.innerText;}// \和"的转换,涉及json,按具体情况而定text = text.replace(/\\/g, "\\\\\\\\");text = text.replace(/\"/g, "\\\\\\\""); 如果对安全没威胁可以的,最好<>等也要转建议找个HTML编辑器,如 fckeditor 就挺好用, 处理你的需求没问题。 JQUERY加载项,为什么只支持IE? 如何根据input内容改变链接a的地址? (代码问题)跟随下拉菜单的浮动广告 请教如何得到表格的行号和列号 input 只允许输入100的倍数 如何写? 按钮实现直接打印 如何得到一个标签里的所有子孙? netscape为什么会把source显示出来? 不知道img标签具不具有如下属性?在线等 调取不到播放记录,麻烦大神看看。100分。在线等 怎样在javascript程序中调用C写的CGI 数据table之间的移动(可能没解释清楚,请进帮忙)
//自定义firefox的innerText
function isIE()
{ //ie?
if (window.navigator.userAgent.toLowerCase().indexOf("msie") >= 1)
return true;
else
return false;
}if (!isIE())
{ //firefox innerText define
HTMLElement.prototype.__defineGetter__("innerText",
function()
{
var anyString = "";
var childS = this.childNodes;
for (var i = 0; i < childS.length; i++)
{
if (childS[i].nodeType == 1)
anyString += childS[i].tagName == "BR" ? '\n' : childS[i].innerText;
else if (childS[i].nodeType == 3)
anyString += childS[i].nodeValue;
}
return anyString;
}
);
HTMLElement.prototype.__defineSetter__("innerText",
function(sText)
{
this.textContent = sText;
}
);
}
//html的解码
WLControl.htmlDecode=function(html)
{
var div=document.createElement("div");
div.innerHTML=html;
return div.innerText;
}
// \和"的转换,涉及json,按具体情况而定
text = text.replace(/\\/g, "\\\\\\\\");
text = text.replace(/\"/g, "\\\\\\\"");