jquery跨域调用json数据


    ?

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

    var ticker = {symbol: 'IBM', price: 91.42};
	function showPrice(data)
	{
         alert("Symbol: " + data.symbol + ", Price: " + data.price);
    }

	showPrice(ticker);
	
	$.getJSON("http://ganbaobao.com.cn/test.php?callback=?",function(data){
	     $.each(data,function(i){
		      alert(data[i]);
		 });
	});

});
</script>

?
$prot = array('a'=>'121abc','b'=>'11a1b12c','c'=>'11assbc','d'=>'11ffgaerbc','e'=>'11adsabc');
$json = JSON($prot);
echo $_GET['callback'].'('.$json.')';

?
 

你可能感兴趣的:(java,工作)