2

I am using jquery mobile and am finding the when i redirect users to new forms the urls are not updated correctly. I recognize that there is some ajax operations going on however, the ulrs are still not being updated when i disable ajax form submits and/or links.

The following js is placed above the link to the mobile-1.0b3.min.js

It is almost like the following is not making any difference.

    <script type="text/javascript">

    //http://jquerymobile.com/demos/1.0a3/#docs/api/globalconfig.html
    $(document).bind("mobileinit", function () {
        //apply overrides here
        $.mobile.ajaxLinksEnabled = false;
        $.mobile.ajaxFormsEnabled = false;
        //$.mobile.defaultTransition = false;
        //$.mobile.loadingMessage = "loading3";
        //$.mobile.pushStateEnabled = true;
    });

</script>

I have found that only if i disable ajax completely do the urls stay current to the page that the user is on.i.e.

$.mobile.ajaxEnabled = false;
David
  • 3,047
  • 4
  • 45
  • 79

2 Answers2

3

I've been bothered by this for weeks now. I posted a similar question here, and put an answer on it for what works for me...

jQuery Mobile/MVC: Getting the browser URL to change with RedirectToAction

Community
  • 1
  • 1
David Hoffman
  • 686
  • 1
  • 6
  • 9
1

1) $.mobile.ajaxEnabled = false; for everything after beta 1.

2) The url will only change if the redirect is done on the client side. I've been having this problem as well so when find a good workaround for it I will let you know (I am assuming that you're trying to do a response.redirect("target") in your code instead of attaching it to a button click event, if it isn't working on button click then I don't know if I can help you).

Twomz
  • 702
  • 10
  • 27
  • 1
    I am using .net mvc 3 and performing server side RedirectToAction() which pushes the user to a new page, but the url is not subsequently getting updated. Yes if i disable ajax across the board with ajaxEnabled=false it works but then I dont get nice transitions etc. – David Sep 28 '11 at 15:50
  • @David, did you ever figure out how to perform a RedirectToAction() without disabling ajax? – Steve May 08 '12 at 22:12