javascript - what happens when i refresh a jquery mobile page -
what happens when jquery mobile page refreshed?
use ajax fetch data in variable called "json" on page1, when user clicks particular dynamically generated element, store id of clicked element in session variable , changepage()
new jqm page2 use json.thepropertyiwant
generate list, works fine, , forward buttons work if refresh page2 json.thepropertyiwant
becomes undefined here error get:
uncaught typeerror: cannot read property 'responsedata' of undefined
i using multipage in single html5 page model
edit:
- i have used variable name
json
, notjson
typed emphasize, think foolish! - i have figured problem. mistake was assuming page refresh call
pageinit
page on works no differently normal html page refresh , triggersdocument.ready
each time ,pageinit
page on.
is there way listenpagerefresh
event , override normal functionality?
i believe generate dynamic content of page2 in event. believe event pageinit or pagecreate. events fire once (if have ajax page load set true). happens request data when load page1 (something pageinit?) when refresh page2, data not there because event request data in, not firing, normal, because when refresh page2, page1 has nothing it. post section of code request data, , section generate dynamic content page2 more.
Comments
Post a Comment