admin管理员组文章数量:1387350
I know that this question is described and answered everywhere, although I can't find what my problem is. this is my code:
<!doctype html>
<html>
<head>
<title>jQM Complex Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href=".3.2/jquery.mobile-1.3.2.min.css" />
<script src=".3.2/jquery.mobile-1.3.2.min.js"></script>
<script src="script.js" type="text/javascript"></script>
<!--<meta http-equiv="Content-Type" content="txt/html; charset=utf-8" />
<script src=".3.2/jquery.mobile-1.3.2.min.js"></script>
<script src="mobileJquery.js"></script>-->
</head>
<body>
<div>
<h1><a href="">test application</a></h1>
<p id="testparagraaf">test</p>
<img src="stront.gif"/>
</div>
<!--<script src="script.js" type="text/javascript"></script>-->
</body>
</html>
and script.js:
$( document ).on('pageload', 'index.html', function(e){
alert('Pageload');
});
I know jquery needs to be loaded before script.js, which is the case here. I tried putting the code into the html, no use...
anyone who knows what the problem is here?
kind regards
I know that this question is described and answered everywhere, although I can't find what my problem is. this is my code:
<!doctype html>
<html>
<head>
<title>jQM Complex Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="http://code.jquery./mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
<script src="http://code.jquery./mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script src="script.js" type="text/javascript"></script>
<!--<meta http-equiv="Content-Type" content="txt/html; charset=utf-8" />
<script src="http://code.jquery./mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script src="mobileJquery.js"></script>-->
</head>
<body>
<div>
<h1><a href="http://www.stronteb.eu">test application</a></h1>
<p id="testparagraaf">test</p>
<img src="stront.gif"/>
</div>
<!--<script src="script.js" type="text/javascript"></script>-->
</body>
</html>
and script.js:
$( document ).on('pageload', 'index.html', function(e){
alert('Pageload');
});
I know jquery needs to be loaded before script.js, which is the case here. I tried putting the code into the html, no use...
anyone who knows what the problem is here?
kind regards
Share Improve this question edited Oct 8, 2013 at 22:03 Evan Davis 36.7k7 gold badges52 silver badges58 bronze badges asked Oct 8, 2013 at 21:56 user1122844user1122844 874 silver badges14 bronze badges 2- 1 possible duplicate of jQuery Mobile getting started error – Omar Commented Oct 8, 2013 at 22:07
-
Also, your alert isn't going to fire.
$(document).on('pageinit', function () { alert('pageinit'); });
check this: view.jquerymobile./1.3.2/dist/demos/widgets/pages – Omar Commented Oct 8, 2013 at 22:13
1 Answer
Reset to default 9You're not loading jQuery itself. You need to load jQuery before you load jQuery Mobile. jQuery Mobile is not jQuery and does not include jQuery.
jQuery Mobile is like jQuery UI: it's essentially a jQuery plugin, and you have to load jQuery before you can load a plugin.
本文标签: javascriptReferenceErroris not defined jquery mobileStack Overflow
版权声明:本文标题:javascript - ReferenceError: $ is not defined jquery mobile - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744556112a2612485.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论