I am building up a PhoneGap app using jQuery Mobile. I want the app to load a html-page from external source and put it to the "content" div of same html-page where the user clicked the link (but to another "page" div of JQM).
- "#booking-content" is the content div where I want the external page to load to.
- "#bookings" is the page div what I want to load and show after the
external page has been loaded. - "#bookings_link" is the ID of the link what the user clicks and where the function call originates from.
Here's click-event -function for the link:
$('#bookings_link').click(function(){'
$("#booking_content").load("http://www.pagetoload.com",function(){
$('#booking_content').trigger("pagecreate").trigger("refresh");
$.mobile.changePage( $("#bookings"), { transition: "slideup"} );
})
I have tried that using jQueryMobile's $.mobile.loadPage -function as well:
$.mobile.loadPage("http://www.pagetoload.com",{pageContainer: $('#booking_content')});
$.mobile.changePage( $("#bookings"), { transition: "slideup"} );
With jQuery's load method, I got the following error message: Uncaught TypeError: Object [object DOMWindow] has no method 'addEvent' at file: and "Unknown chromium eroor: -6"
I have also tried to include the logic into the pagebeforechange-loop (http://jquerymobile.com/demos/1.0/docs/pages/page-dynamic.html) but without results. From that, the app is saying: *Uncaught TypeError: Cannot read property 'options' of undefined at file:///android_asset/www/jquery.mobile-1.1.1.min.js:81*
I have set true the $.support.cors and $.mobile.allowCrossDomainPages settings for cross-domain linking.
I am using jquerymobile 1.1.1 and jquery's core 1.7.1. I am testing it with Android SKD api level 16 AVD.
One weird thing is that I got the pageloading functionality working earlier with the same logic, but since I haven't used SVN I have no possibility to check where's the error in this.
I am completely stuck with this and I would be very grateful if someone could show me the right direction.