【发布时间】:2014-02-06 05:14:36
【问题描述】:
我写了下面的命令,生成一个数据网格,它工作正常没有问题,但是命令很长,如果我使用 enter 将命令分解为不同的行,jquery 命令会出错并且不会回应。
有没有办法分解这个长命令?
$("#mainholder ul").append('<li><p><table><th id="contentWrapper"><font size="+2" face="Gotham, Helvetica Neue, Helvetica, Arial, sans-serif" style="font-weight:bold" color="#FF0000">'+poId+'</font></th><th id="contentWrapper"><img src="../images/products/iPhone.png" width="80" height="80"/></th><th class="itSt"><font color="#FF0000" >'+itStat+'</font></th><th id="contentWrapper"><table><tr><td class = "tdinfo"><lable class="titleCs">Price : </label><input id="'+usId+'<seperator>'+orId+'<seperator>'+poId+'" class="contentInput" onClick="priceClk(this.id)"></td></tr><tr><td class = "tdinfo"><lable class="titleCs">Quantity : </label><input id="'+usId+'<seperator>'+orId+'<seperator>'+poId+'" class="contentInput" onClick="qtyClk(this.id)"></td></tr><tr><td class = "tdinfo"><lable class="titleCs">Express : </label><input id="'+usId+'<seperator>'+orId+'<seperator>'+poId+'" class="contentInput" onClick="expClk(this.id)"></td></tr></table></th><th id="contentWrapper"><table><tr><td><textarea id="'+usId+'<seperator>'+orId+'<seperator>'+poId+'" onClick="offDesc()" class="commentBox"></textarea></td></tr></table></th> <th id="contentWrapper"><table><tr><td><textarea id="'+usId+'<seperator>'+orId+'<seperator>'+poId+'" onClick="yorDesc()" class="commentBox"></textarea></td></tr></table></th> <th id="contentWrapper"><table><tr><td> <img class="css-checkbox" src="../images/deleteIcon.png" width="20" height="20" alt=""/></td></tr><tr><td><input id="" class="css-checkbox" type="checkbox" /></td></tr></table></th></table></div></p></li>');
【问题讨论】:
-
向我们展示您的故障尝试和错误
-
任何理解 JavaScript 的文本编辑器都应该可以做到。像 VS + R#...
-
您可以在代码中的 + 符号后添加新行。要在其他地方插入新行,你必须这样做:part1 + part2 + part3 + ....
标签: javascript