Response title
This is preview!
$.mobile.changePage('to', options)
function - Let's figure it out if my problem can be solved by both using this function and the pageload
event (I couldn't find in the domumentation if you can use same options argument for pageinit event)...reloadPage
> Can be setted to true when new data is required despite I don't know what else JQM framework is going to do even what does it means in terms of functionality...data
> I really need to able to set this into a json object. But I haven't make this work yet...pageload
event?pageload
event? reloadPage
= true exactly entail?So, when a user click on a restaurant from the list I need to take data from the server and placing into the different target wrappers from RestaurantProfile.html but first of all this page has to be injected into the DOM because it's not possible to load data into an isolate page and then inject it into the DOM. That's not possible.
Let's figure it out if my problem can be solved by both using this function and thepageload
event (I couldn't find in the domumentation if you can use same options argument for pageinit event)...
It's completely unnecessary to generate a "clean" page and then manually inject data from the server yourself. This only increases the number of server-side requests that you're doing resulting in worse performance. Just generate the page on the server side with all of the data instead of generating an empty page and then performing another server-side request to retrieve data to "inject it into the DOM" in the pageinit event.Just have the server generate the complete page.
OK. Could you let me know how, please?It most certainly is possible. It sounds like you don't really understand how jQuery Mobile page navigation and server-side requests really work and you're trying to build an overly-complicated "solution" for what jQuery Mobile already does for you.
Ummm, yeah, let's not... Perhaps the old adage "Just because you can doesn't mean you should" might apply in this scenario.
It's completely unnecessary to generate a "clean" page and then manually inject data from the server yourself. This only increases the number of server-side requests that you're doing resulting in worse performance. Just generate the page on the server side with all of the data instead of generating an empty page and then performing another server-side request to retrieve data to "inject it into the DOM" in the pageinit event.
Generate the complete page server-side and then add it to the DOM means also include header and footer everytime. You can not re-use some static html neither. Every page has its own model, view and controller but I don't want lo load them unless the page is required (not in case of complete page generation). That's what I mean for a "clean" app structure. As the application functionality increases so does javascript lines. That's not optimal at all because of standard device memory restrictions.Just have the server generate the complete page.
pageinit event - It must be placed into the corresponding page and will trigger a function allways.
Neither pageload
event is triggered, page2.html is shown and I have acces to myJsonObject
pageload is triggered on the document, not the page. It has a special purpose and is not needed here.
© 2013 jQuery Foundation
Sponsored by and others.