我使用jQuery发射GET请求但没有得到响应可能是什么问题? 以下是html代码。我正在显示一个警告使用jquery从url获取响应
请人给我提供了一些运行的例子,其中应该使用一些知名的网站,我还可以访问像http://www.google.co.in或http://www.jlcindia.com
error:error
<html>
<script type="text/javascript" src="jquery-1.8.1.min.js"></script>
<Script Language="JavaScript">
function getFullName(){
//alert('fun call');
$.ajax({
type: "GET",
url: "http://www.jlcindia.com",
dataType: "html",
success: function(data) {
alert('success'+data);
},
error: function(xhr, textStatus, errorThrown) {
if (textStatus !== null) {
alert("error: " + textStatus);
} else if (errorThrown !== null) {
alert("exception: " + errorThrown.message);
}
else {
alert ("Don't know what is error");
}
}
});
}
</Script>
<body>
<input type="button" value="Show Full Name" onClick="getFullName()">
</body>
</html>
你会得到错误吗? –
是否有任何警报提示,即。 “有趣的电话”之一。 – Orbling
这是一个跨域请求吗? – undefined