goto page javascript not working in android
I am creating webapp using html5, css3, javascript, Phonegap in
dreamweaver. I am using below code to do a goto page feature. it will open
a an html page. but my problem is it's not working in android app. any
help?
javascript Code
function gotopage(id){
var num = document.getElementById(id).value;
var jarry =
["pagenotfound.html","ch1/1.html","ch1/2.html","ch1/3.html","ch1/4.html","ch1/5.html","ch1/6.html"];
if(jarry[num] == null)
num = 0;
window.location.href =
window.location.pathname.substring(0,window.location.pathname.substring(1).indexOf("/"))+jarry[num];
//window.location.href = "/"+jarry[num];
Html code
<input type="text" id="t1" size="4px"/>
<input type="button" value="Goto Page" onClick="gotopage('t1')"/>
I am getting error message on android " application error: A network error
occurred. (file:///android_asset/ch1/1.html)
No comments:
Post a Comment