Home > DeveloperSection > Forums > jQuery Mobile “Error Loading Page”
ezra heywood
ezra heywood

Total Post:145

Points:1019
Posted on    April-10-2013 1:47 AM

 JQuery JQuery 
Ratings:


 2 Reply(s)
 3729  View(s)
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.


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    April-15-2013 7:48 AM

Hi Ezra!

You should be using the jquery mobile specific methods.

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

Vijay Shukla

Total Post:100

Points:700
Posted on    April-15-2013 7:56 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick