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的替代函数
浙公网安备 33010602011771号