Jquery html(val)使用注意

Jquery的html(val)可以方面的向页面元素内部插入html代码,但要注意插入的html代码中不能包含script代码块,如果包含<script>….</script>这样的代码jquery会在插入的时候自动过滤掉,遇到这样的问题最好的方法还是用document.getElementById(”div”).innerHTML=html最保险。

Tags:

This entry was posted on 星期四, 五月 27th, 2010 at 1:46 下午 and is filed under Web开发. You can follow any responses to this entry through the RSS 2.0 feed.

相关文章

“Jquery html(val)使用注意”的一条留言

Hiro 六月 7th, 2010 at 12:45 下午

这确实值得注意!!!

[回复]

评   论

  请放心,不会公开的