jquery 请求apache solr 跨域解决方案

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
var url = "http://172.21.0.31:13131/solr/xml/select?q=*%3A*&wt=json&indent=true";
$(function(){
//1.getJSON 方式
$.getJSON(url+"&json.wrf=?", function(data){
console.log(JSON.stringify(data));
}); //2.ajax 方式
$.ajax({
'url': url,
//'data': {'wt':'json', 'q':'your search goes here'},
'success': function(data) {
console.log(JSON.stringify(data));
},
error : function() {
alert('1');
},
'dataType': 'jsonp',
'jsonp': 'json.wrf'
});
});
</script>
上一篇:python---协程 学习笔记


下一篇:Python参数传递(传值&传引用)