I am working on phonegap application. I am trying to login and on click of the submit button in the Login.html i should be redirected to a local html file.
Login.html
<tr>
<td> </td>
<td>
<input type="submit" class="submitbtn" name="submit"
id="submit" value="Login" onclick="loginCheck()">
</td>
</tr>
loginValidation.js
if (validCustomer == true) {
alert("valid customer........");
document.location.href("file:///android_asset/www/Category.html");
But document.location.href
or window.location
/window.open
doesn't work. Can anybody help on this issue?
If i use window.open and run the application in emulator it works fine but not in the device.
I am working on phonegap application. I am trying to login and on click of the submit button in the Login.html i should be redirected to a local html file.
Login.html
<tr>
<td> </td>
<td>
<input type="submit" class="submitbtn" name="submit"
id="submit" value="Login" onclick="loginCheck()">
</td>
</tr>
loginValidation.js
if (validCustomer == true) {
alert("valid customer........");
document.location.href("file:///android_asset/www/Category.html");
But document.location.href
or window.location
/window.open
doesn't work. Can anybody help on this issue?
If i use window.open and run the application in emulator it works fine but not in the device.
- 1 The Load.html page was on top of the stack and Category.html was below that window. Closing the Load.html page first and trying to open the Category.html by using window.open("Category.html") worked fine. – AndroGeek Commented Oct 4, 2011 at 7:00
4 Answers
Reset to default 5you can try this
window.open("mainpage.html",'_self');
this will open page in current window so that current window page data get flush and new page data will render in same window page dom.
try using relative path, this should work:
window.location="Category.html";
Try this
window.location.replace = "Category.html";
window.location.href = 'Category.html';