今天遇到jQuery.getJSON的缓存问题。
如果其调用的url之前曾经调用过的话,回调函数就会直接在缓存里面取得想要得值,而不是进入到后台,调用存储过程了。
这是一个比较郁闷的问题。不修改的话,用户就只能从新打开一个新页面才能进行修改了。
我刚刚接触jQuery,对其害不太了解,于是上网查了查解决办法。
总结一下:
1 让每次调用的url都不一样
方法:在参数中加一个随机数或添加一个时间戳。
例1:
jQuery.getJSON("$!{Root}/a/a/s.ashx",{"ID":id,"Name":name,"Path":path,random:Math.random()},function(responseText){}

$.getJSON('./AjaxHandler.ashx', { id: 0, rnd: Math.random() }, function (data) {

随机推荐

  1. Android对Sqlite数据库的增删改查

    SqLite 数据库 Google 为我们提供了sqlite相关的api SqLiteOpenHelper 这是一个抽象的类 如果想要使用的话,需要其他的类去继承他 SqLiteDatabase 类 ...

  2. 一个关于react-native的demo,详细请转GitHub

    react native 0 介绍 支持ios和android两个平台 下载:git clone https://github.com/chunlei36/react-native-full-exam ...

  3. 利用Microsoft Sql Server Management studio 创建数据库的示例

    利用Microsoft Sql Server Management studio 创建数据库的示例方法如下:   一.打开安装好的Microsoft Sql Server Management stu ...

  4. BZOJ2976 : [Poi2002]出圈游戏

    首先模拟一遍得到n个同余方程,然后用扩展欧几里得求出最小的可行解即可,时间复杂度$O(n^2)$. #include<cstdio> #define N 30 int n,i,j,k,x, ...

  5. systemtap 脚本示例

    .[root@localhost ~]# stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}' Pass ...

  6. wordpress入门

    安装bitnami wordpress. 打开仪表盘:开始菜单--Bitnami Wordpress协议栈 Manager Tool -- Go to Appllication -- Access W ...

  7. IEnumerable是集合,IEnumerator是集合的迭代器

    我们常用IEnumerable,却忽视IEnumerator.简单来说,IEnumerable是可以被循环遍历的集合,IEnumerator实施循环遍历. 接口分别是: public interfac ...

  8. 集群服务器下使用SpringBoot @Scheduled注解定时任务

    原文:https://blog.csdn.net/huyang1990/article/details/78551578 SpringBoot提供了 Schedule模块完美支持定时任务的执行 在实际 ...

  9. SpringBoot集成JWT实现token验证

    原文:https://www.jianshu.com/p/e88d3f8151db JWT官网: https://jwt.io/ JWT(Java版)的github地址:https://github. ...

  10. Java Calendar,Date,DateFormat,TimeZone,Locale等时间相关内容的认知和使用(4) DateFormat

    本章主要介绍DateFormat. DateFormat 介绍 DateFormat 的作用是 格式化并解析“日期/时间”.实际上,它是Date的格式化工具,它能帮助我们格式化Date,进而将Date ...