# Character In Url Of Jquery Mobile Page
Solution 1:
Edit: I stepped through your page to see what was going on.
Your grief is caused by jQuery Mobile. When the page loads, it detects this as an "page change", and because jQuery Mobile uses the hash (#
) to emulate the back-button for AJAX requests, it also has some special handling for pages that it sees are loaded with a hash.
The bottom line is that it sees a page load, decides it should "reject" it, and prevents anything further from happening.
My guess is that the jQuery Mobile team didn't expect anyone to load a mobile page with a hash on init, since the code seems to assume that the first load of the page will not have one.
To follow this yourself, set a breakpoint in the function isEmbeddedPage
in jquery.mobile-1.0.min.css
.
A possible solution would be to somehow prevent the jQuery Mobile code from running when the page initially loads. This might break other stuff that jQuery Mobile provides, though.
Solution 2:
As says It turns out jQM parses hashes for its own purposes and just freezes if it can't make sense of them on load (unnecessarily aggressive behaviour if you ask me, they should at least fire a custom event — although there is a high priority issue reported for it on GitHub).
One solution is to disable jQM's hash processing: before DOM ready, execute the following:
$.mobile.hashListeningEnabled = false;
Note this will necessarily break any functional reliance on jQM's history polyfill on browsers that don't support history pushState (IE etc).
Post a Comment for "# Character In Url Of Jquery Mobile Page"