如何使用javascript更改cordova上的位置
如何使用javascript更改cordova上的位置,javascript,php,jquery,cordova,Javascript,Php,Jquery,Cordova,函数loginState(){ $.ajax({ 键入:“POST”, url:“https://www.examplesite.com", contentType:“application/json;charset-utf-8”, 数据:JSON.stringify({ 动作:“appLoginState” }), 成功:功能(结果){ 如果(结果['state']==false){ window.location.href=(“file:///android_asset/www/index
函数loginState(){
$.ajax({
键入:“POST”,
url:“https://www.examplesite.com",
contentType:“application/json;charset-utf-8”,
数据:JSON.stringify({
动作:“appLoginState”
}),
成功:功能(结果){
如果(结果['state']==false){
window.location.href=(“file:///android_asset/www/index.html");
}else if(结果['state']==true){
window.location=('main.html');
}
},
错误:函数(xhr、状态、错误){
警报(xhr.responseText);
}
});
}
当您使用window.location.href
时,现在会发生什么?它运行一次,我有一个结果,但显示被锁定,任何地方都无法单击,因为屏幕不断刷新。if(result['state']==false){//window.location.href=“index.html”}else if(result['state']==true){//window.location.href=“main.html”}当我创建注释行时,应用程序正确运行