在http://code.google.com/p/jqueryjs/downloads/list 下载了jquery-1.3.2.js,更名为jquery.js<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello, jQuery World!</title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery.js"></script>
</head><body>
<div id="divMsg">Hello World!</div>
<input id="btnShow" type="button" value="显示" />
<input id="btnHide" type="button" value="隐藏" /><br />
<input id="btnChange" type="button" value="修改内容为 Hello World, too!" />
<script type="text/javascript" >
("#btnShow").bind("click", function(event) { ("#divMsg").show(); });
("#btnHide").bind("click", function(event) { ("#divMsg").hide(); });
("#btnChange").bind("click", function(event) { ("#divMsg").html("Hello World, too!"); });
</script>
</body>
</html>以上代码存储为1.html,与jquery.js在同一个目录里。运行了一下,出现了错误。怎么回事?是不是缺点什么?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello, jQuery World!</title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery.js"></script>
</head><body>
<div id="divMsg">Hello World!</div>
<input id="btnShow" type="button" value="显示" />
<input id="btnHide" type="button" value="隐藏" /><br />
<input id="btnChange" type="button" value="修改内容为 Hello World, too!" />
<script type="text/javascript" >
("#btnShow").bind("click", function(event) { ("#divMsg").show(); });
("#btnHide").bind("click", function(event) { ("#divMsg").hide(); });
("#btnChange").bind("click", function(event) { ("#divMsg").html("Hello World, too!"); });
</script>
</body>
</html>以上代码存储为1.html,与jquery.js在同一个目录里。运行了一下,出现了错误。怎么回事?是不是缺点什么?
解决方案 »
- 求一份高德地图的驾车查询实例
- window.open下载文件,急求高手!
- 请问如何通过父页面中的js代码实现对打开子页面进行定时刷新
- 怎么实现登录又不跳转到登录信息页面?
- javascript不起作用,是怎么回事?
- html5菜鸟 请问一下 为什么 html2canvas 通过dom生成canvas时候会忽略 circle 标签
- <base>在javascript中不起作用?
- 如何点击文字执行js
- 求助,帮个改改这段代码,自动填充选项
- qq怎么做手机端核pc端聊天
- 以下代码在IE上正常,但在firefox下频繁闪动,请高手帮忙,解决立即给分。多谢!
- 100分求解jquery返回值问题!!疑惑啊。。。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello, jQuery World!</title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>
</head><body>
<div id="divMsg">Hello World!</div>
<input id="btnShow" type="button" value=">f示" />
<input id="btnHide" type="button" value="趨藏" /><br />
<input id="btnChange" type="button" value="修改内容:N Hello World, too!" />
<script type="text/javascript" >
$("#btnShow").bind("click", function(event) { $("#divMsg").show(); });
$("#btnHide").bind("click", function(event) { $("#divMsg").hide(); });
$("#btnChange").bind("click", function(event) { $("#divMsg").html("Hello World, too!"); });
</script>
</body>
</html>