摘要: HTML代码:<button type="button" onclick="fun1()">跨域访问</button><script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>js代码: // 跨域访问问题 function jsonCallBack(url,callback) { $.getScript(url,function(){ callb 阅读全文
posted @ 2013-06-03 16:50 liufeilai 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 1.停止事件冒泡 //阻止事件冒泡 function stopEventBubble(event){ var e=event || window.event; if (e && e.stopPropagation){ e.stopPropagation(); } else{ e.cancelBubble=true; } }2.阻止事件默认行为。//如果提供了事件对象,则这是一个非IE浏览器 if (e && e.preventDefault) { ... 阅读全文
posted @ 2013-06-03 12:27 liufeilai 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>显示隐藏文字</title> 6 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> 7 </head> 8 <body> 9 <div>10 <p cla 阅读全文
posted @ 2012-09-14 20:51 liufeilai 阅读(538) 评论(0) 推荐(0) 编辑