JQuery Mobile & URL Parameters white flash on reload

折月煮酒 提交于 2019-12-25 07:33:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!