array(2) { ["docs"]=> array(0) { } ["count"]=> int(0) } 111string(0) "" int(1) int(10) int(70) int(8640000) string(13) "likecs_art_db" array(1) { ["query"]=> array(1) { ["match_all"]=> object(stdClass)#28 (0) { } } } array(1) { ["createtime.keyword"]=> array(1) { ["order"]=> string(4) "desc" } } int(10) int(0) int(8640000) array(2) { ["docs"]=> array(0) { } ["count"]=> int(0) } jQuery AJAX 跨域请求 - 爱码网

跨域请求 只要 dataType : 'jsonp',  jsonp:"jsoncallback",  然后返回一个json格式的就可以了

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>|体检系统</title>
</head>
<body>

<script src="http://cdn.bootcss.com/jquery/1.7.2/jquery.min.js"></script>

<script type="text/javascript">
 
$(function(){

$.ajax(  
    {  
        type:'get',  
        url : 'http://www.taobao.com?loginuser=lee&loginpass=123456',  
        dataType : 'jsonp',  
        jsonp:"jsoncallback",  
        success  : function(data) {  
           alert(data)
        },  
        error : function() {  
            alert('fail');  
        }  
    }  
);  
});
</script>


</body>

</html>

 

相关文章: