拼接html字符串时处理引号
2011-12-25 09:50
204 查看
var parXfkhdm="lxdmxs['mx"+showNumber+"'].xfkhdm";
var parXfkhzt="lxdmxs['mx"+showNumber+"'].khzt";
var parWldm="lxdmxs['mx"+showNumber+"'].wldm";
var parTzsl="lxdmxs['mx"+showNumber+"'].tzsl";
var html="<tr order='"+showNumber+"'>";
html+="<td class='rd8'><input type='text' name=\""+parXfkhdm+"\" id='xfkhdm' ref='xfkhdm' /><input type='hidden' name=\""+parXfkhzt+"\" ref='khzt' /><input
class='button1' type='button' id='aButtonXfkhdm' value='选择' onclick='openXfkh("+showNumber+");' /></td>";
html+="<td class='rd8'><input type='text' id='wldm' name=\""+parWldm+"\" ref='wldm' /><input class='button1' type='button' id='aButtonWldm' value='选择' onclick='openWlxx("+showNumber+");' /></td>";
html+="<td class='rd8'><input type='text' name=\""+parTzsl+"\" id='tzsl' ref='tzsl' /></td>";
html+="<td class='rd8'><input name='aButtonDelete' class='button1' type='button' value='删除' onclick='deleteNode("+(showNumber++)+");' /></td></tr>";
$("#show").append(html);
因为参数中有单引号,在包裹参数时需要使用转义字符\";
var parXfkhzt="lxdmxs['mx"+showNumber+"'].khzt";
var parWldm="lxdmxs['mx"+showNumber+"'].wldm";
var parTzsl="lxdmxs['mx"+showNumber+"'].tzsl";
var html="<tr order='"+showNumber+"'>";
html+="<td class='rd8'><input type='text' name=\""+parXfkhdm+"\" id='xfkhdm' ref='xfkhdm' /><input type='hidden' name=\""+parXfkhzt+"\" ref='khzt' /><input
class='button1' type='button' id='aButtonXfkhdm' value='选择' onclick='openXfkh("+showNumber+");' /></td>";
html+="<td class='rd8'><input type='text' id='wldm' name=\""+parWldm+"\" ref='wldm' /><input class='button1' type='button' id='aButtonWldm' value='选择' onclick='openWlxx("+showNumber+");' /></td>";
html+="<td class='rd8'><input type='text' name=\""+parTzsl+"\" id='tzsl' ref='tzsl' /></td>";
html+="<td class='rd8'><input name='aButtonDelete' class='button1' type='button' value='删除' onclick='deleteNode("+(showNumber++)+");' /></td></tr>";
$("#show").append(html);
因为参数中有单引号,在包裹参数时需要使用转义字符\";
相关文章推荐
- oracle存储过程中单引号及字符串拼接处理
- 拼接html字符串时单引号问题
- matlab 字符串处理(单引号、拼接、char)
- oracle存储过程中单引号及字符串拼接处理
- oracle存储过程中单引号及字符串拼接处理
- [置顶] oracle存储过程中单引号及字符串拼接处理
- oracle存储过程中单引号及字符串拼接处理
- js中字符串处理常用的方法(字符分割、字符拼接、截取字符串、是否包含一个字符串)
- 处理字符串的一些js/jq方法(去除HTML,去除空格,计算真实长度,截取中英文字符)
- JavaScript中字符串的拼接出错,单引号双引号混合使用
- atitit.js的 字符串内容 转义 js处理html
- js拼接html字符串的注意事项
- php处理html字符串
- POJ 2271 HTML (字符串处理)
- [C#技术] .NET种Json时对单引号和特殊字符串的处理
- 存储过程之处理多笔拼接字符串数据
- 多段HTML拼接的优化处理
- shell 处理字符串常用方法http://www.blogjava.net/xzclog/archive/2011/03/04/345745.html
- Prototype源码浅析 String部分(三)之HTML字符串处理
- Web.Config中配置字符串含引号的处理