App Hub
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (4 posts)

Back button broken for url hashes in IE on WP7 Mango

Last post 7/14/2011 4:51 AM by D-Software. 3 replies.
  • 7/13/2011 6:33 AM

    Back button broken for url hashes in IE on WP7 Mango

    Mango seems to have brought along with it a broken browser...

    When you link to an anchor on your page using a hash, the back button doesn't seem to work too well.

    For example, go to http://jquerymobile.com/demos/1.0b1/. Those in the know will realise why... To put it simply, jQuery Mobile uses hash changes to navigate between "pages" in a single or multiple page web application. It uses the hash changed events to determine when to use javascript to request the next page, load it into the DOM and perform an animation to display the next page.

    Navigating forward on a jQuery Mobile site works perfectly as expected. It's when you hit the back button that things go wrong. On a desktop browser, going from the landing page to "Into to jQuery Mobile" swipes in the intro page and hitting back swipes it out again to show the landing page. However, on Mango, hitting the back button when on the intro page does nothing. If you were on another site before you went the the demo landing page, then hitting the back button again will take you back to the previous site.

    I have been working on an embedded web application recently and this has been driving me crazy! I'm seeing a Navigated event being raised by the WebBrowser control when it goes to the second page in the application, but back buttons (and manually invoking history.back() and history.go(-1) in javascript) just don't do anything.

    This seems to be a breaking change to me and would potentially mean I push to have Windows Phone 7 dropped as a targetted platform for the (relatively high traffic) website I am working on. An embarrassing idea seeing as I pushed for it to be targetted... :-(
  • 7/13/2011 9:14 AM In reply to

    Re: Back button broken for url hashes in IE on WP7 Mango

    Ok, so this currently works on RTM / NoDo, just not in "Mango".

    But, this also appears to be an issue for a fruit Phone running Safari.

    It seems to get "lost" on the first page, but when navigating deeper and deeper it actually remembers the previous page, just everything else in the backstack isn't there for that site.
  • 7/13/2011 10:46 PM In reply to

    Re: Back button broken for url hashes in IE on WP7 Mango

    I wouldn't exactly consider this an issue on iOS. Safari does fine until you navigate to an external page. Then it seems the url history tracking gets a bit muddled when you come back. Otherwise, it works perfectly.

    On the other hand, Mango just doesn't work at all. And it's not a jQuery Mobile issue causing it - it's the browser behaviour. IE is just plain broken.

    I've confirmed on previous versions of the emulator that IE exhibits the expected behaviour, so this appears to be an IE9 Mobile issue.
  • 7/14/2011 4:51 AM In reply to

    Re: Back button broken for url hashes in IE on WP7 Mango

    The issue is a little deeper than I initially realized. If you define a simple page with an anchor at the top of the page referencing a div at the bottom of the page then we see some more exotic behaviour. Clicking the link and hitting back will work the first time. However, you'll notice that in the address bar the hash is not removed from the URL. This means that clicking the link and hitting back again will get the browser into a tangle. Here is the HTML snippet I used:

    <a href="#bottom">bottom</a>
    <div style="height: 1000px"></div>
    <a id="bottom" href="#" onclick="BLOCKED SCRIPThistory.back();return false;">back</a>

    If you feel like testing this, hit up http://duc.as/test/hash.html.
Page 1 of 1 (4 posts) Previous Discussion Next Discussion