I just started playing with jQuery Mobile Alpha 2 and a crazy little bug associated with links got my head spinning the other day. If you read through the API Documentation you will see that a normal link, such as <a href=”blog.html”>blog</a>, will be hijaxed if the browser supports it. However, when I click on the link and view a page within the same directory as the referring page, the linked page displays with no style. It looks like a plain HTML page with no CSS as opposed to a cool looking jQuery Mobile Page.
Turns out this is a bug with the latest release and there are a few ways to fix it. My solution was to just append a “?” at the end of the url of the link. I did it with a bit of unobtrusive jQuery, but just appending the “?” to the url manually will work as well.
Appending the “?” will cause the blog.html page to be rendered correctly within the browser. If you are just starting out with jQuery Mobile Alpha 2 and come across this bug, I hope this quick post helps you out.
Yep. This bug has been fixed. Grab the latest from github.
Oh, wow. You’re a lifesaver. Have they got this patched on github yet?
Yes, I just started with JQuery mobile and I noticed it, I thought I had done something wrong at first, then I researched and I found your blog.
I think I will use version 1.0a1 for now.