Software Archive
Read-only legacy content
17060 Discussions

Confused on Frameworks

Dan_K_
Beginner
468 Views

If I start a new project with HTML5 + Cordova, and I select jquery-mobile as the framework, I don't see any code that loads jquery or jquery-mobile. Shouldn't there be a couple of <script src=... in one of .js files?

I should also note that the reason I want jquery-mobile is to be able to run some javascript when a page loads, e.g.

$(document).on("pageshow","#pagetwo",function(){ // When entering pagetwo
  alert("pagetwo is now shown");
});
Is there's a better way to do this?

Thanks,
-dk


 

 

0 Kudos
2 Replies
Rakshith_K_Intel
Employee
468 Views

The jquery.mobile scripts and stylesheets will be added after you drag and drop some UI component in the "design" view.

Go to "design" view in the develop tab, drag the header or button, and then switch to "code" view, you will see the jquery js and css added to the index.html

 

 

0 Kudos
Dan_K_
Beginner
468 Views

Found a simple solution:

<body onpageshow="welcomePage()"> will fire the welcomePage() function in app.js anytime the page (in my case welcomePage.html) is loaded. Exactly what I need.

 

0 Kudos
Reply