javascript - $.mobile.changepage(URL) getting "Error Loading Page" with PhoneGap -


i working on first phone gap application , having bit of trouble trying navigate other pages.

on index html have

        $.mobile.pagecontainer.pagecontainer("change", "nextpage.html", {      reload: true,      transition: "slide"} ); 

but keep getting error loading page message appearing , nothing happens.

from looking around online can assume has nextpage.html not being found don't understand why not being found. please note have tried /nextpage.html , ./nextpage.html , several others without success

both pages in root of www folder

can see going wrong?

thanks

edit worth noting code working in firefox

as requested here javascrtipt capture firebug

<!doctype html> <!-- licensed apache software foundation (asf) under 1 or more contributor license agreements. see notice file distributed work additional information regarding copyright ownership. asf licenses file under apache license, version 2.0 (the "license"); may not use file except in compliance license. may obtain copy of license @ http://www.apache.org/licenses/license-2.0 unless required applicable law or agreed in writing, software distributed under license distributed on "as is" basis, without warranties or conditions of kind, either express or implied. see license specific language governing permissions , limitations under license. --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> <link rel="stylesheet" type="text/css" href="css/index.css" /> <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.2.min.css" /> <title>test app</title> <script src="js/jquery-1.9.1.js"></script> <script src="js/jquery-ui.js"></script> <script src="js/jquery.mobile-1.4.2.min.js"></script> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/index.js"></script> </head> <body> <div id="indexpage" data-role="page"> <div class="login"> <h1>network</h1> <div id="loginform" class="blink loginform"> <img src="../logo.png" alt="logo" style="height:50%; text-align:center;" /> <p class="event listening">connecting network</p> <p class="event received">user name</p> <input type="text" class="event input" id="username"/> <br class="event received" /> <p class="event received">password</p> <input type="password" class="event input" id="password" /> <br /> <input type="button" title="log in" value="log in" class="event submit" onclick="javascript:calllogin()" /> <p class="error" id="invalid">invalid login details</p> </div> </div> <script type="text/javascript"> $(document).bind("mobileinit", function () { $.support.cors = true; $.mobile.allowcrossdomainpages = true; }); // app.initialize(); </script> <script type="text/javascript"> function calllogin() { var companyid = ""; console.log('start function'); source: { console.log('start ajax call'); $.support.cors = true; $.ajax({ crossdomain: true, url: "http://webservice/webmethod", type: "post", datatype: "json", contenttype: "application/json; charset=utf-8", data: "{ 'username' : '" + document.getelementbyid('username').value + "','password' : '" + document.getelementbyid('password').value + "'}", datafilter: function (data) { return data; }, success: function (data) { if (data.d[1] == 'false') { seterror('invalid'); } else { companyid = data.d[0]; set_localstorage('companyid', companyid); console.log('companyid (success) = ' + get_localstorage('companyid')); $.mobile.pagecontainer.pagecontainer("change", "nextpage.html", { reload: true, transition: "slide"}); } }, error: function (error) { console.log('companyid (fail) = ' + companyid); console.log(error.status); console.log(error.statustext); console.log(error.responsetext); } }); } console.log('end ajax call, companyid = ' + companyid); } </script> </div> </body> </html>  


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -