jQuery Mobile Alpha 2 Bug with Links

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.

jQuery Mobile Alpha 2

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.

David Hayden

This entry was posted in jQuery Mobile. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

3 Responses to jQuery Mobile Alpha 2 Bug with Links

  1. davidhayden says:

    Yep. This bug has been fixed. Grab the latest from github.

  2. Oh, wow. You’re a lifesaver. Have they got this patched on github yet?

  3. Carlos says:

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>