随笔分类 - JavaScript
摘要:事件冒泡是事件代理的基础 ,其实在DOM的操作中冒泡无处不再,可能自己都没有感觉到~Q1:什么是事件冒泡 就像有一栋的房子有18层,最底层的人说着火了,从下到上,将消息传上去,同时每一层的人都会对着火了这个消息作出不同或相同的处理,也可以不处理。整个过程就像冒泡一样。example:Buble <!DOCTYPE html><html> <head> <title>事件冒泡</title> <meta http-equiv="Content-Type" content="text/html; cha
阅读全文
摘要:1.$(document).ready(function(){});//作用就是让大家都准备好2.<script type="text/javascript" src="jquery.js"> </script>//这样就可以载入函数的文件,就像php的一样3.$(selector).action(function(){ $(selector).action(function(){ });//another action}) ; //basic grammar
阅读全文
摘要:how to use function?Function<html><head> <script type="text/javascript" > function display(){ document.location.href="http://www.baidu.com" } </script></head><body><input type="button" value="test" onmouseover="displ
阅读全文
摘要:1.10s later ,it will close<html><body onload='setTimeout("mm()",10000)'><script>function mm(){window.close();}</script>hello</body><html>2.10s later and it turns to new web page.html><head><title>10秒后跳转</title></head>&l
阅读全文

浙公网安备 33010602011771号