问题
I am using query mobile for a phonegap application, I am passing through parameters through the url to the next page.
For example:
main.html?id=1, menu.html?id=2 etc
To allow this I have to turn ajaxEnabled
to false to allow it to pass through the information I need. In doing so I am unable to use transitions from page to page which means I get a white flash as the page reloads.
I am generating these links dynamically.
$.ajax({
url: 'URLTO WEBSERVER',
dataType: 'jsonp',
jsonp: 'jsoncallback',
timeout: 5000,
success: function(data, status){
$.each(data, function(i,item){
var list = '<li><a href="menu.html?idcat='+item.id_cat+'">'+item.category_cat+'</li>'
output.append(list);
});
},
error: function(jqXHR, textStatus) {
alert( "Request failed: " + textStatus );
output.text('There was an error loading the data.')
}
});
Is there a solution?
回答1:
you can use method jquery serialize data for your paramater. via changePage method in jquery I hope solved :D
回答2:
I think he is concerned about the "white plash page" that happens after the request is completed from server and then he calls changePage. He is not worried about how to send parameters to server etc. This is assuming all that is working fine.
来源:https://stackoverflow.com/questions/17783602/jquery-mobile-url-parameters-white-flash-on-reload