zoukankan      html  css  js  c++  java
  • jsonP 现在360浏览器竟然阻止本机 jquery load一些html js什么的

    别的浏览器正常可以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 id="huoqu">获取</div>
    <div id="wk"></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!";}
     
    ?>
    

      

  • 相关阅读:
    IBM Minus One(water)
    约瑟夫问题的循环链表实现
    双向链表(差不多)
    单向链表的建立,插入,删除(复习一下)
    找新朋友(欧拉函数)
    验证角谷猜想(hd1279)
    Wolf and Rabbit(gcd)
    Big Number(大数)
    字串数(高精度组合数)
    寻找素数对(hd1262)
  • 原文地址:https://www.cnblogs.com/pengchenggang/p/3582538.html
Copyright © 2011-2022 走看看