我一直试图获得一个简单的HTTP,以便将基于cordova的应用程序连接到服务器(基于php)。
我只为测试目的编写了一个简单的php文件。
Php代码:
<?php
if (isset($_POST["TEST"])){
echo "TEST WORKS!!";
}
?>
现在我的cordova application>中的jquery代码
// For an introduction to the Blank template, see the following documentation:
// http
我正在用ReactJS开发一个web应用程序,我想用axios执行一个GET请求。首先,我尝试使用下面这行代码:
axios.get("http://localhost:8080/MyWebApplication/MyServlet").then(data=>{
//Code
});
但我得到了以下错误:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/WebApplication1
这是nodejs服务器: var express = require('express');
var app = express();
app.use(express.static('public'));
const server = require('http').createServer(app);
server.listen(1437, function(){
console.log('https and websocket listening on *:1437');
}); 客户端是: var socketOpti