jQuery Mobile “Error Loading Page”

Total Post:145

Points:1019
JQuery 
 5283  View(s)
Ratings:
Rate this:
Hi Everyone!

I am using Jquery1.8.2 and Jquery-mobile 1.1

When i click on Logout button i have to goto the Home page. I am able get the home page but before going back to the home page got the "Error Loading Page" message.

Test.html

<body>  
  <div data-role="page">
      <div data-role="header" data-theme="b" >
          <h1> Success Page </h1>
           <a data-role="button" id="logoutbtn" data-theme="b">Logout</a>
       </div><!-- /header -->
       <div data-role='content'>            
    </div>
</div>
</body>
test.js

$(document).ready(function(){   
$("#logoutbtn").click(function () {     
    document.location.href = "Home.html";
});
});

Please help me out on this.
  1. Post:604

    Points:4228
    Re: jQuery Mobile “Error Loading Page”

    Hi Ezra!

    You should be using the jquery mobile specific methods.

    $.mobile.changePage("Home.html");
    See document-location-href-location-vs-mobile-changepagelocation

  1. Post:100

    Points:700
    Re: jQuery Mobile “Error Loading Page”

    Hi!

    Instead of

    document.location.href = "/Home.html";

    try as below

    document.location.href = "./Home.html";
    Its working fine and able to go back to home page with out any error.

Answer