JavaScript - - By Sam Deering

jquery mobile “error loading page” workaround

If your seeing a quick error message popup on the screen when redirecting the page to another (or you might be forcing a reload).


Instead of using this:

window.location.href = "/";

Use this:

$.mobile.changePage('/', { reloadPage: true, transition: "none"} );

or if that doesn’t work try this:

$.mobile.changePage('./', { reloadPage: true });

That should fix it. If it don’t then try this, overriding the default settings for the ajax loading error (not recommended but will hack fix it).

$.mobile.pageLoadErrorMessage = "";


$(document).bind("mobileinit", function(){
  $ = bar;

If that still don’t fix it, maybe your using the file protocol?


Login or Create Account to Comment
Login Create Account