Easyui DataGrid under IE reload failure problem

Source: Internet
Author: User

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:

    1. 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)

    2. 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. :(

    3. 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.
Summarize

So 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
    1. http://blog.csdn.net/quwenzhe/article/details/30228663

Easyui DataGrid under IE reload failure problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.