Jquery无法正常工作 [英] Jquery not working properly
本文介绍了Jquery无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到了Jquery的一些问题,
它没有工作,控制台说$未定义,但是我已经链接了jquery,所以它应该有用吗?有什么想法吗?
这是我的Html
Im having some issues with Jquery,
It isnt working and the console is saying $ is undefined, however i have linked jquery, so it should work? Any ideas?
Here is my Html
<html>
<head>
<link type = "text/css" rel = "stylesheet" href = "main.css"/>
<script src = "main.js"></script>
<script src = "http://code.jquery.com/jquery-2.0.3.js"></script>
</head>
<body>
<div id = "click">Click me!</div>
</body>
</html>
继承人我的javascript / Jquery:
Heres my javascript/Jquery:
$(document).ready(function(){
var count = 0;
$('#click').click(function(){
count++;
document.write(count);
});
});
推荐答案
未定义,但是我已经链接了jquery,所以它应该管用?有什么想法吗?
这是我的Html
is undefined, however i have linked jquery, so it should work? Any ideas?
Here is my Html
<html>
<head>
<link type = "text/css" rel = "stylesheet" href = "main.css"/>
<script src = "main.js"></script>
<script src = "http://code.jquery.com/jquery-2.0.3.js"></script>
</head>
<body>
<div id = "click">Click me!</div>
</body>
</html>
继承人我的javascript / Jquery:
Heres my javascript/Jquery:
( document )。ready( function (){
var count = 0 ;
(document).ready(function(){ var count = 0;
(' #click')。click( function (){
count ++;
document .write(count);
});
});
('#click').click(function(){ count++; document.write(count); }); });
这篇关于Jquery无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文