1

Okay, before I get buried in sea of red tape for asking a frequently asked question, please hear me out. I am using Phonegap to develop a mobile web app and jQuery for swiping between different pages. By different pages, I mean different HTML files and not divs within one html file. For illustrative purposes, let us take two html files out of the lot I have in the app.

  1. index.html
  2. test.html

Assume that the control is in test.html and I do the following

<!DOCTYPE html> 
<html> 
    <head>     
        <title>Test</title>     
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />    
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>    
        <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>        
        <script>    
        $(function(){        
          $("#home").bind('swipeleft',function(event, ui){
                          $.mobile.changePage("../index.html", "slide");
                          });       
          });
        </script>
</head> 
<body> 
    <div data-role="page" id="home">    
        <div data-role="header">        
            <h1>Main Page</h1>    
        </div>
        <div data-role="content">            
            <p>Slide finger left</p>
        </div>
    </div>
</body>
</html>

I read the discussion here and tried adding "&callback=?" to the end of index.html. That removed the error "Origin null is not allowed by Access-Control-Allow-Origin", but it propped up a new one "Resource not found". The following errors were obtained in Webkit based browsers (Mobile Safari, Chrome). I ran the file in Firefox and got a plain "Error Loading Page" alert on the screen.

Please help me out with this situation. A million thanks in advance!

Community
  • 1
  • 1
thandasoru
  • 1,558
  • 2
  • 15
  • 41

0 Answers0