视频网站开发费用/seo诊断站长
参见英文答案 >
Ways to circumvent the same-origin policy 11个
我可以访问一个API,它是一个JSP文件并且是JSON格式的.我试图从JSP页面获取这些数据到PHP脚本并处理它们然后存储在我的MySQL服务器中.
JSON字符串在我在少量JSON Formatter和验证器在线检查的JSP页面中有效.
这是我用来从页面获取JSON数据的代码,但每次我的ajax调用失败时.
$('#button').click(function(e){
var url = 'http://xxxxx:8080/StudentAPI/index.jsp';
$.ajax({
url : url,
dataType : 'json',
success : function(response) {
alert('Success');
},
error : function(request, textStatus, errorThrown) {
alert(request+textStatus+errorThrown);
}
});
e.preventDefault();
})
请帮助我,并建议以更好的方式做到这一点,我们总是欢迎.