读书人

jquery第一期:运作第一个jquery

发布时间: 2013-10-08 16:55:16 作者: rapoo

jquery第一期:运行第一个jquery

首先下载js文件,网址jquery.com去下载,可以下载1.10版的


首先打开editplus进行编辑,添加js文件:

jquery第一期:运作第一个jquery


编写代码:



我们完全可以简化我们的代码,

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title><script type="text/javascript" src="js/jquery-1.10.1.js"></script><script type="text/javascript">   $(function()   {   alert("hello jquery");   });</script></head><body></body></html>
也就是说document.ready是可以省略的。




读书人网 >Web前端

热点推荐