<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JQuery测试</title>
<style type="text/css">
</style>
<script language="javascript" src="jquery.js">
</script>
<script language = "JavaScript" type="text/javascript">
$(document).ready(function(){
$("a").click(function(){
alert("hello world!");
});
});
</script>
</head>
<body>
<a href= >test</a>
</body>
</html>代码可以在ie下运行,但是不能在firefox下运行~~
$("a").each(function(){
$(this.bind("click",function(){
alert("hello world!");
});
});
});
我测试环境
Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1
jQuery.noConflict();