zoukankan      html  css  js  c++  java
  • -_-#【jsonp】cache

    Cache jQuery’s JSONP Calls

    <script src="http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.3.min.js"></script>
    <script>
        $.ajax({
            url: 'http://www.google.com.hk/',
            dataType: 'jsonp',
            cache: true,
            jsonpCallback: 'jj',
            success: function(data) {}
        })
    </script>

    浏览器缓存

    服务器生成缓存功能还没实现。但访问获取的还是旧数据。结果是浏览器缓存了。

    旧版本 jQuery 的 cache 默认是 true

    <script src="http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.3.min.js"></script>
    <script>
        $.ajax({
            url: 'http://www.google.com.hk/',
            dataType: 'jsonp',
            success: function(data) {}
        })
    </script>
    <script src="http://static01.baomihua.com/js/lib/jquery-1.4.4.min.js?t=20120926.js"></script>
    <script>
        $.ajax({
            url: 'http://www.google.com.hk/',
            dataType: 'jsonp',
            cache: false,
            success: function(data) {}
        })
    </script>

      

    <script src="http://static01.baomihua.com/js/lib/jquery-1.4.4.min.js?t=20120926.js"></script>
    <script>
        $.ajax({
            url: 'http://www.google.com.hk/',
            dataType: 'jsonp',
            success: function(data) {}
        })
    </script>
  • 相关阅读:
    springboot 整合 memcached l
    文件处理工具类 l
    执行脚本工具类 l
    LRU l
    归并排序 l
    Redis 数据类型 l
    git 常用操作命令 唏嘘
    postmanPOST请求 status 415错误 唏嘘
    MySQL 启动和关闭MySQL服务 唏嘘
    OO和OP
  • 原文地址:https://www.cnblogs.com/jzm17173/p/3531524.html
Copyright © 2011-2022 走看看