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
Add a ment  | 

1 Answer 1

Reset to default 9

You'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