<bean:write> 内容含有引号如何避免?50积分~
bean:write 内容含有引号如何处理?50积分~~JScript codescript languageJavaScriptfunction initOp
<bean:write> 内容含有引号如何处理?50积分~~
JScript code<script language="JavaScript">function initOption(type) { document.forms[0].myOp.options.length = 0; <logic:iterate id="myOpNumList" indexId="index" name="SiteForm" property="myOpNumList" type="com.common.vo.basic.myOpForm"> document.forms[0].myOp.options.add(new Option("<bean:write name='myOpNumList' property='label' filter='false'/>","<bean:write name='myOpNumList' property='ID'/>")); </logic:iterate>}
这里<bean:write name='myOpNumList' property='label' filter='false'/>取得的label内容中有双引号,会导致页面出错,该如何处理?这里这能在页面处理,不能在后台直接替换。
谢谢~~ 急啊~~
小弟新手啊
[解决办法]用转义符转义下
[解决办法]var str = "<bean:write name='myOpNumList' property='label' filter='false'/>";
while (str.indexOf('"') >= 0){
str = str.replace('"', "");
}
[解决办法]在每个“前加个\
[解决办法]var str = "<bean:write name='myOpNumList' property='label' filter='false'/>";
while (str.indexOf(') >= 0){
str = str.replace(', "");
}
直接前台处理也行
[解决办法]个人觉得到后台处理还好点。
[解决办法]"变成 \" 不行吗?