2019年7月20日
摘要: function ajax(obj){ var defaults = { type : 'get', async : true, url : '#', dataType : 'text', jsonp : 'callback', data : {}, success:function(data){c 阅读全文
posted @ 2019-07-20 14:37 ziyou11 阅读(123) 评论(0) 推荐(0) 编辑
  2019年7月11日
摘要: <input type="button" value="显示效果" id="btn"/><div id="dv"></div><script src="common.js"></script><script>// my$("btn").onclick=function () {// //获取元素距离 阅读全文
posted @ 2019-07-11 11:36 ziyou11 阅读(194) 评论(0) 推荐(0) 编辑
摘要: <input type="button" value="按钮" id="btn1"/><input type="button" value="干掉第一个按钮的事件" id="btn2"/><script src="common.js"></script><script> //绑定事件的兼容 func 阅读全文
posted @ 2019-07-11 10:24 ziyou11 阅读(133) 评论(0) 推荐(0) 编辑
摘要: <input type="button" value="按钮" id="btn"/><script src="common.js"></script><script> //为任意元素.绑定任意的事件, 任意的元素,事件的类型,事件处理函数 function addEventListener(elem 阅读全文
posted @ 2019-07-11 10:16 ziyou11 阅读(87) 评论(0) 推荐(0) 编辑
摘要: <script> //第一个节点和第一个元素的获取的代码在IE8中可能不支持 //element.firstChild >谷歌和火狐获取的是第一个子几点 //element.firstChile >IE8获取的是第一个子元素 //element.firstElementChild >谷歌和火狐是第一 阅读全文
posted @ 2019-07-11 09:41 ziyou11 阅读(142) 评论(0) 推荐(0) 编辑
  2019年7月10日
摘要: <style> div{ width: 300px; height: 200px; border: 2px dotted red; } </style></head><body><input type="button" value="显示效果" id="btn"/><input type="butt 阅读全文
posted @ 2019-07-10 21:24 ziyou11 阅读(357) 评论(0) 推荐(0) 编辑
摘要: <style> div { width: 200px; height: 150px; border: 2px solid red; } </style></head><body> <input type="button" value="设置值" id="btn"/><div id="dv">哦,太神 阅读全文
posted @ 2019-07-10 21:22 ziyou11 阅读(264) 评论(0) 推荐(0) 编辑