0

When I navigate to a different page in my project in IE (and sometimes chrome) the new URL is added to the old one.

For example, if this is my original URL: localhost:49866/Home/Index

and I was to navigate to a different page, that URL is added to the old one like this:

localhost:49866/Home/Index#/Newpage

I've found that this is an ajax thing which makes it easier to retrieve old pages. However, is there a way to fix this without disabling my ajax?

The only solution I've found is to disable my ajax completely using this script:

$(document).ready(function () {
  if ($.browser.msie || $.browser.webkit) {

    $("a").attr("data-ajax", "false");
    $("a").attr("rel", "external");

    var a = $("form");
    if (a != null) {
        $("form").first().attr("data-ajax", "false");
        $("form").first().attr("rel", "external");
    }
  }
});
4

1 回答 1

0

您可以在每个 jquery-mobile 页面上设置您想要的任何 url。在 data-role="page" div 上使用 data-url 属性,如下所示:

<div id='myJQMPage' data-role="page" data-url="/the/url/i/want")>
</div>
于 2013-08-02T14:14:59.657 回答