jquery想执行id中添加代码,html函数
$("#see").html("//这一行总是报Stringliteralisnotproperlyclosedbyamatchingquote这个错误<ulid='we...
$("#see").html(" //这一行总是报String literal is not properly closed by a matching quote这个错误
<ul id='weekul'>
<c:forEach var='week' items='${weeklist}'>
<li onclick='selectDayLi(${week.key})'
id='${week.key}'>${week.value}</li>
</c:forEach>
</ul>
");
大神们给看看,怎么回事 展开
<ul id='weekul'>
<c:forEach var='week' items='${weeklist}'>
<li onclick='selectDayLi(${week.key})'
id='${week.key}'>${week.value}</li>
</c:forEach>
</ul>
");
大神们给看看,怎么回事 展开
2个回答
展开全部
js的换行,就表示此语句结束,不能这么写。
html("string"); 要放在一行内
或者你可以
<textarea style="display:none" name="test" id="aa" cols="30" rows="10">
<ul id='weekul'>
<c:forEach var='week' items='${weeklist}'>
<li onclick='selectDayLi(${week.key})'
id='${week.key}'>${week.value}</li>
</c:forEach>
</ul>
</textarea>
<script type="text/javascript">
$("#see").html($('#aa').html());
</script>
找个容器存着数据先。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询