---
title: " jQuery 的 .get和.post和.ajax方法IE的兼容问题 "
author: "onedada"
date: "2014-11-06T16:55:05Z"
tags: []
categories: ["编程语言"]
slug: "jquery-get-post-ajax-ie"
draft: false
lastmod: "2014-11-06T16:55:05Z"
id: 2153113
url: "https://onedada.iteye.com/blog/2153113"
---

本文转载自：   http://blog.csdn.net/muziduoxi/article/details/7541800

 

 

最近发现不少朋友遇到这样的问题，也就是用jQuery的时候呢，.get方法在FireFox浏览器下可以正常获取值并显示，但是在IE下呢就非然，这个主要是因为IE的缓存的问题，可以这样解决：

**\[html]** [view plain](http://blog.csdn.net/muziduoxi/article/details/7541800 "view plain")[copy](http://blog.csdn.net/muziduoxi/article/details/7541800 "copy")

01. &lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;
02. &lt;script type="text/javascript"&gt;
03. $(document).ready(function(){
04. setInterval("shuaxin()",1000);
05. });
06. function shuaxin(){
07. var url = "nongyixia.php?timeStamp=" + new Date().getTime();
08. $.get(url,function(data){
09. $(".name").empty();
10. $(".name").append(data+"&lt;br&gt;");
11. });
12. }
13. &lt;/script&gt;
14. &lt;div class="name"&gt;&lt;/div&gt;

这个代码是定时更新的，在URL后面加一个时间参数，

```
在你提交地址的时候在后面加一个时间戳就行了，IE就会每次刷新了。
```