1、代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>第一个jquery程序</title> <!--引入jquery依赖包--> <script type="text/javascript" src="../jquery-1.11.3.js"></script> <script type="text/javascript"> //第一种写法 /* $(document).ready(function() { alert("hello jquery"); }); */ //第二种写法(常用) $(function() { alert("hello jquery"); }); </script> </head> <body> </body> </html>