ReferenceError: $ is not defined jquery mobile

ReferenceError: $ is not defined jquery mobile

本文关键字:defined jquery mobile not is ReferenceError      更新时间:2023-09-26

我知道这个问题到处都有描述和回答,尽管我找不到我的问题是什么。 这是我的代码:

    <!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.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
        <script src="http://code.jquery.com/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.com/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>

和脚本.js:

$( document ).on('pageload', 'index.html', function(e){       
    alert('Pageload');
});

我知道jquery需要在脚本.js之前加载,这里就是这种情况。我尝试将代码放入 html 中,没有用...

有谁知道这里的问题是什么?

亲切问候

你没有加载jQuery本身。您需要在加载 jQuery Mobile 之前加载 jQuery。jQuery Mobile 不是 jQuery,也不包括 jQuery。

jQuery Mobile 就像 jQuery UI:它本质上是一个 jQuery 插件,你必须先加载 jQuery,然后才能加载插件。