别的浏览器正常可以jquery.load本机文件,但是360浏览器不行了,缺德啊!!
jsonP代码
index3.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>新浪微博登陆</title> <script src="http://src.house.sina.com.cn/imp/imp/deal/76/2c/8/89ccf4d7713da2a3de542f6bc67_p1_mk1.js"></script> <script> $(document).ready(function(){ $.ajax({ type: "GET", jsonpCallback:"jsonp_callback", url: "http://src.house.sina.com.cn/imp/imp/deal/0e/de/4/3162f0c12449b478f0f2dfdaf4a_p1_mk1.js", dataType: "jsonp", success: function(data, textStatus, jqXHR){$("#wk").html(data.k);} }); }); </script> </head> <body> <div >获取</div> <div ></div> </body> </html>
k1.html
jsonp_callback({"k":"err!!"});
补充一个 serverReferer.php
<?php $jsonp_callback=$_GET['jsonp_callback']; echo $jsonp_callback,'({"msg":"ok"})'; //http://www.cnblogs.com/hancf/archive/2012/03/17/2404119.html 资料1 //if ("http://tj.house.sina.com.cn/zhuanti/jSinaWeibo/index.shtml" == $_SERVER['HTTP_REFERER']) //{echo "ok!";} //else{echo "err!";} ?>