摘要: 1.动态脚本当网站需求变大,脚本的需求也逐步变大。我们就不得不引入太多的JS 脚本而降低了整站的性能,所以就出现了动态脚本的概念,在适时的时候加载相应的脚本。比如:我们想在需要检测浏览器的时候,再引入检测文件。1234567891011var flag = true; //设置true 再加载 if (flag) { loadScript('browserdetect.js'); //设置加载的j... 阅读全文
posted @ 2013-06-07 12:49 烧点饭 阅读(2058) 评论(1) 推荐(0) 编辑
摘要: 访问元素的标签名1234<div id="myDiv">text</div> var div=getElementById("myDiv"); alert(div.tagName); //"DIV",HTML中标签名是大写的1.HTML元素略2.取得特性123var div=document.getElmentById("myDiv"); alert(div.getAttribute("id"))... 阅读全文
posted @ 2013-06-07 12:38 烧点饭 阅读(2839) 评论(0) 推荐(0) 编辑
摘要: JavaScript通过document类型表示文档。在浏览器中,document对象是HTMLDocument的一个实例,表示整个HTML页面。document对象是window对象的一个属性。Document特征:nodetype的值为9 nodename的值为"#document" nodevalue的值为null parentnode的值为null ownerDocument的值为null... 阅读全文
posted @ 2013-06-07 12:37 烧点饭 阅读(3501) 评论(2) 推荐(0) 编辑