Support for page redirection in Jquery mobile using Ajax calls

Viewed 2632

I am building a JQuery Mobile application based on a MVC framework.

My problem is that I cannot send "redirect" directives (either HTTP, Javascript, META-refresh) to the browser.

It results in the browser displaying a single line : "undefined".

Here is the code for the redirect on the server side :

<html><head>
      <script>location.href='$url'</script>
</head></html>

I know that I can fix the problem by using data-ajax=false, but i don't want that since :

  • I want nice Jquery mobile transitions
  • This is much faster in Ajax
  • I don't want to wonder for each link whenever the framework might send a redirect

Is there a way to make JQuery Mobile handle correctly one kind of redirect ? either HTTP, HTML META or Javascript ?

2 Answers
Related