在使用iframe会发现,有时iframe的数据不会刷新,这是因为浏览器对iframe做了缓存,更改了请求后,他还是发送的原来的请求,这个问题可以通过三个途径解决 response设置no-cache 清理浏览器缓存 销毁iframe重新创建 我使用第三种方法解决了iframe数据无法刷新的问题 var widgetIFrame = $('#widgetIFrame'); var widgetIFrameParent = widgetIFrame.parent(); widgetIFrame.remove(); widgetIFrameParent.append("<iframe id=\"widgetIFrame\" style=\"width: 100%;height: 600px\" src=\"\"></iframe>"); var widgetIFrameNew = $('#widgetIFrame'); widgetIFrameNew.attr('src',encodeURI('http://localhost:8086/widgetModel..... 有更新! 处理缓存导致的iframe不刷新的问题 程序人生