JQUERY MOBILE “ERROR LOADING PAGE”

ezra heywood

Total Post:145

Points:1019
Posted by  ezra heywood
JQuery 
 4657  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. AVADHESH PATEL

    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. Vijay Shukla

    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

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!