jQuery的同时使用此代码和funtion GET不工作:
window.onload = function(){
$.get("http://mixsoft.cf/s/status.php?ip=190.60.215.195&port=8080", function(data){
alert(data);
});
};
jQuery的同时使用此代码和funtion GET不工作:
window.onload = function(){
$.get("http://mixsoft.cf/s/status.php?ip=190.60.215.195&port=8080", function(data){
alert(data);
});
};
移动你的回调函数.complete
使用&的data.responseText
代替data
。
$.get('http://mixsoft.cf/s/status.php?ip=190.60.215.195&port=8080').complete(function(data){
console.log(data.responseText)
alert(data.responseText);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
不要忘了导入下面的标记在HTML页面中。
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
这个答案为时尚早:) –
它实际上不起作用,因为该页面是HTTPS。 –
但答案很公平。 –
你运行到CORS?如果我不拥有域,我会查找控制台,并且返回的数据假定为'application/json',而'JSON.parse'不是有效的json。 –
'不工作'不是一个问题。你应该问问题。 –