zoukankan      html  css  js  c++  java
  • Jquery 跨域请求

    <html>
    <head>
        <title>Test Jquery</title>
     
        <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" data-do-not-move="true" data-provides="jQuery"></script>
       
        <script>
            //????
            function showData (result) {
                var data = JSON.stringify(result); //json???????
                $("#text").val(data);
            }
    
            $(document).ready(function () {
    
                $("#btn").click(function () {
                    //跨域请求百度
                    $("head").append("<script src='https://feed.baidu.com/feed/api/wise/feedlist?sid=124614_125822_114552_122159_119747_125649_123094_125354_120127_118887_118869_118851_118835_118790_107312_125007_117332_124977_117431_125776_122789_125653_125312_124939_125487_125172_125288_125710_125283_124937_125038_125466_124030_110085_123289_125645_125427&ssid=d22777677363640500&from=844b&pu=sz%25401320_1001%252Cta%2540iphone_2_4.3_3_534&qid=3271620540&clickDownload=0&tabId=1&page=1&sessionId=15366596716398&crids=&startlistnum=8&rfs=7&loadeditems=newsThree%2CtypeLargePics%2CecomAds%2C&_=1536659683951&callback=showData'></script>");
                });
    
            });
        </script>
    </head>
    <body>
        <input id="btn" type="button" value="kuayu POST" />
        <textarea id="text" style=" 400px; height: 100px;"></textarea>
    
    </body>
    </html>
    

      

    更多:参考 https://www.cnblogs.com/chiangchou/p/jsonp.html

  • 相关阅读:
    代码外的软技能——吉他自学过程
    利用栈实现括号匹配(python语言)
    django框架--登录注册功能(ajax)
    ajax的get请求
    docker 制作自己的镜像
    Mysql group by之 Error 1055
    ssh 远程连接
    python实现--九九乘法表
    mysql5.7安装和卸载过程
    javascript随机变色--案例
  • 原文地址:https://www.cnblogs.com/wgscd/p/9629368.html
Copyright © 2011-2022 走看看