How to disable automatic ajax calls when dynamically creating pages
Instead of using ajax calls, I create and inject pages into the $.mobile.pageContainer.
When I want to access a page with a hash tag (one that is generated in my onReady function), jQuery mobile tries to make an ajax call. It fails. When my onReady function is called, I have to check the url and call $.mobile.changePage() to make it show up.
var loc = window.location.href;
var loc = loc.split('#').pop();
if (loc !== "http://lift.pageforest.com/") {
$.mobile.changePage(loc, 'pop', false, true);
}
That's all fine, but jQuery Mobile has still made a failed ajax call resulting in an error thrown to the console as well as a big error div shown to the user.
I tried overriding the $.mobileinit function ajaxEnabled() to false because I will never use ajax.
Unfortunately that created a whole bunch of other problems.
Why does jQuery mobile automatically assume that I want to use ajax, and I will not generate any content in my own onReady function? How do I work around this?