我在http://language.cs.usm.my/synthesis/read.php的表单上有一个textarea。此URL是第三方网页,我如何将我的内容发布到该URL并替换现有的textarea内容。
到目前为止,我尝试使用下面的方法将我的内容发布到URL,但它似乎没有这样做。
$scope.AudioCont = function(){
var req = $http({
method: 'POST',
url: 'http://language.cs.usm.my/synthesis/read.php',
data:{
test:"Nama saya ialah Ali"
}
})
.then(
function (response) {
alert("The data has been posted");
console.log(response);
},
function() {
alert("Failed to post!");
})
}
任何人对此有何建议?预先感谢。
使用dataType:'jsonp'在构建参数时执行跨站点请求。 – siimsoni
如果[CORS已启用](http://stackoverflow.com/questions/25845203/understanding-cors),则无法发布到其他域。 [跨域后](http://stackoverflow.com/a/2699351/2246862) –