jQuery 只建立一个名为jQuery的对象,$是jQuery 别名

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!-- 引入 jQuery -->
<script src="../scripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
//等待dom元素加载完毕.
jQuery(document).ready(function(){
    alert("Hello World!");
});
</script>
</head>
<body>
</body>
</html>

jQuery 只建立一个名为jQuery的对象,$是jQuery 别名

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!-- 引入 jQuery -->
<script src="../scripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
//等待dom元素加载完毕.
$(document).ready(function(){
    alert("Hello World!");
});
</script>
</head>
<body>
</body>
</html>

 

posted @ 2017-10-16 17:21  sky20080101  阅读(133)  评论(0)    收藏  举报