摘要: <script type="text/javascript"> // var value = 0; // createRequest(); // function createRequest(){ // if(XMLHttpRequest){ // var xhr = new XMLHttpRequ 阅读全文
posted @ 2016-03-06 11:45 mingjixiaohui 阅读(147) 评论(0) 推荐(0) 编辑
摘要: ajax封装 function ajax(method,url,type,fn){ // if(XMLHttpRequest){ // var xhr = new XMLHttpRequest(); // }else{ // var xhr = new ActiveXObject("Microsof 阅读全文
posted @ 2016-03-06 11:42 mingjixiaohui 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1.event 事件 function move(ev){ var oEvent = ev || event;  //前者ie     后者event是ff 谷歌 }   attachEvent添加绑定事件ie支持    addEventListener兼容其他浏览器 var oDiv = docu 阅读全文
posted @ 2016-03-06 11:37 mingjixiaohui 阅读(233) 评论(0) 推荐(0) 编辑
摘要: div{ width:100px; height:100px; background:red; } <div></div> <script type="text/javascript"> var oDiv = document.getElementsByTagName("div")[0]; oDiv 阅读全文
posted @ 2016-03-06 11:21 mingjixiaohui 阅读(247) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript"> // a = 0;//全局变量 // function test(){ //// var a = 1;//局部变量 // a = 1; // alert(a); // } // test(); // var a = 0; // func 阅读全文
posted @ 2016-03-06 11:18 mingjixiaohui 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-03-06 11:17 mingjixiaohui 阅读(249) 评论(0) 推荐(0) 编辑
摘要: function stopProp(e){ var event = event||window.event;//前者event兼容非ie 后者兼容ie //阻止冒泡 if(event.stopPropagation){ event.stopPropagation() }else{ event.can 阅读全文
posted @ 2016-03-06 11:13 mingjixiaohui 阅读(150) 评论(0) 推荐(0) 编辑
摘要: <div id="outer"> <div id="middle"> <div id="inner"></div> </div> </div> #outer{ width:400px; height:400px; background:red; overflow:hidden; } #middle{ 阅读全文
posted @ 2016-03-06 11:07 mingjixiaohui 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-03-06 11:04 mingjixiaohui 阅读(119) 评论(0) 推荐(0) 编辑
摘要: var oDiv = document.getElementsByTagName("div")[0]; // oDiv.onclick = function(){ // alert(1); // } // oDiv.ondblclick = function(){ // alert(1); // } 阅读全文
posted @ 2016-03-06 11:03 mingjixiaohui 阅读(218) 评论(0) 推荐(0) 编辑