Jquery 中的$

 

在jQuery库中,$就是jQuery的简写形式,如$("p")和jQuery("p")是等价的;

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/jscript" src="scripts/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(
function() {
     window.alert("hello world"};
 );
</head>

<body>
</body>
</html>
$(document).ready(
function() {
     window.alert("hello world"};
 );

此函数是window.onload的替代函数

posted on 2012-07-17 11:21  zhuyanyan  阅读(164)  评论(0)    收藏  举报