1
我已经包含了所需的文件:不能发布使用AJAX英特尔XDK
,但似乎无法让我的AJAX后提交。似乎事件在帖子前停止。我正在开发一个使用IntelXDK的应用程序,并没有很多关于如何使AJAX后期工作的细节...不知道我错过了什么。有任何想法吗?
我的ajax:
$.ajax({
url : 'http://xx.xxx.xx.x/check_access.php',
type: 'POST',
data : {'thisusername':thisusername, 'thispassword':thispassword},
dataType: 'Text',
success: function(data, textStatus, jqXHR)
{
if(data==1){
localStorage.setItem("username2", thisusername);
location.assign("./community-home.html");
} else {
function funcError1() {
var iframe5 = document.createElement("IFRAME");
iframe5.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe5);
window.frames[0].window.alert('Username or Password does not exist.');
iframe5.parentNode.removeChild(iframe5);
}
funcError1();
}
},
error: function(){
//$("#user-result").html("Username available!");
function funcError() {
var iframe4 = document.createElement("IFRAME");
iframe4.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe4);
window.frames[0].window.alert('Something went wrong. Close the application and try again');
iframe4.parentNode.removeChild(iframe4);
}
funcError();
console.log('There was an error');
}
});
return false;
}