Easyui DataGrid under IE reload failure problemProblem
Recently using Easyui to develop back-end systems, testing found a wonderful problem, $(‘dg‘).datagrid(‘reload‘);
when reloading the tabular data, ie little response. It was later discovered that it was not unresponsive, but that the browser used the cache.
Solution Solutions
Online users summed up the solution has the following several:
Timestamp after the URL, so that the first load and reload access to the URL inconsistent, so that the system can not use the IE cache. The test found that the Easyui request was followed by a string of random numbers _145232xxx, but IE would still use the cache. Later I in the request JS in the URL Plus will rand=xxx(Math.rand()生成的随机数)
not use the cache. (I tested it from IE8 to IE11)
Clear the cache in the same order as in add <meta>
:
<META HTTP-EQUIV="pragma" CONTENT="no-cache"><META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"><META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
Unfortunately, like many netizens, this method I also failed. :(
Declare the method of the DataGrid's load corresponding to ' POST ', which is the quickest solution. But there are a few questions:
- If the service-side interface does not support post mode, it will be a break.
- If the server interface itself can be controlled, this way for the front-end compromise, will cause the interface is not restful! Be aware that the RESTful interface is basically a GET method for query design.
SummarizeSo it is still the first method, in the URL itself plus random number to use, forgive me code neat don't want to change the server Interface _ (: З"∠) _.
Reference
- http://blog.csdn.net/quwenzhe/article/details/30228663
Easyui DataGrid under IE reload failure problem