<script>
$(document).ready(function(){
$("#monthTree").load("monthTree.html",function(){
$(this).youiTree();
$(this).show();
});
});
</script>大家先看一下这段脚本,我实在是不知道,那个$什么意思?还有$(document).ready(function()是读取什么吗?这几行我都不清楚,望大家给解释一下。谢谢了!
$(document).ready(function(){
$("#monthTree").load("monthTree.html",function(){
$(this).youiTree();
$(this).show();
});
});
</script>大家先看一下这段脚本,我实在是不知道,那个$什么意思?还有$(document).ready(function()是读取什么吗?这几行我都不清楚,望大家给解释一下。谢谢了!
了解一下jquery就知道了$是一个很基本的命令了~你有没有发现你研究的代码里面除了那些奇怪的$,
还一定有这么一行:
<script src="jquery.js" type="text/javascript"></script>
jquery.js里写了好多东西~
$(document).ready(function(){
//将monthTree.html页面html代码插入ID为"monthTree"的html标签中,function()获取monthTree.html完成后执行
$("#monthTree").load("monthTree.html",function(){
$(this).youiTree(); //$(this)为$("#monthTree")控件,youiTree()不清楚功能
$(this).show(); //显示ID为"monthTree"的html标签
});
});
$(document).ready(function(){
//将monthTree.html页面html代码插入ID为"monthTree"的html标签中,function()获取monthTree.html完成后执行
$("#monthTree").load("monthTree.html",function(){
$(this).youiTree(); //$(this)为$("#monthTree")控件,youiTree()不清楚功能
$(this).show(); //显示ID为"monthTree"的html标签
});
});
$(document).ready(function()相当与<body onload="">明白了吧,下面就是jquery