0

I have written an exernal js file and in it is one function. In this function I am trying to call $.mobile.showPageLoadingMsg(); How would I do this? I have tried the following and it doesnt work:

function test() {
     $.mobile.showPageLoadingMsg();
}

The order of script inclusion on the html is shown below:

<script src="jquery.mobile-1.1.1.min.js"></script>

<script src="jquery-1.7.2.min.js"></script>

<script src="cordova-2.0.0.js"></script>

<script src="master.js"></script>

and master.js is the one that makes the call.

4
  • 1
    If you see the javascript console, do you see any error? Have you used the file AFTER the jquery mobile library inclusion? Commented Sep 24, 2012 at 13:52
  • Cannot call method 'showPageLoadingMsg' of undefined Commented Sep 24, 2012 at 13:54
  • This means that you have included your external file BEFORE the inclusion of the jquery mobile js Commented Sep 24, 2012 at 13:55
  • I have edited the question. Is that what you mean by BEFORE the inclusion of the jquery mobile js? Because I still get the error after changing the order of <script> tags. Commented Sep 24, 2012 at 14:01

2 Answers 2

1

You have to load the jQuery library before the jQuery mobile library.

Sign up to request clarification or add additional context in comments.

Comments

1
<script src="jquery-1.7.2.min.js"></script>

<script src="jquery.mobile-1.1.1.min.js"></script>

<script src="cordova-2.0.0.js"></script>

<script src="master.js"></script>

jQuery min javascript file before mobile.js ok?

view: http://jsfiddle.net/7fxQf/24/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.