从 ajax 调用 phonegap 中的 node.js 文件?
call node.js file from ajax call in phonegap?
我想通过 ajax 调用来调用 node.js 文件但无法调用,请帮助我了解 ajax 中将输入哪种类型的 URL调用 node.js 文件。
如果您在客户端使用Jquery
您可以这样提出请求:
$.ajax({
url: 'your-url',
success: function(data) {
//it works, do something with the data
},
error: function() {
//something went wrong, handle the error and display a message
}
});
您可以在此处阅读更多详细信息PhoneGap and JSON API
我想通过 ajax 调用来调用 node.js 文件但无法调用,请帮助我了解 ajax 中将输入哪种类型的 URL调用 node.js 文件。
如果您在客户端使用Jquery
您可以这样提出请求:
$.ajax({
url: 'your-url',
success: function(data) {
//it works, do something with the data
},
error: function() {
//something went wrong, handle the error and display a message
}
});
您可以在此处阅读更多详细信息PhoneGap and JSON API