No FAQ for Get and Post methods in jquery Ajax

Source: Internet
Author: User

Today encountered a very strange phenomenon, and later found that the original Ajax get way, after loading once, is not access to the database, and post method every time access to the database


Case requirements, when clicking on the "Project information list" record line, linkage loading "Project interface Information List"

$ (#projectGrid #). DataGrid ({   onclickrow:function (rowindex,rowdata) {          var url = root_path + "/projectinterface/queryprojectinterfacelist.do?pid=" +rowdata.mdid;         $.ajax ({             type: "GET",        url:url,        success:function (Result) {            console.info (Result);             var converdata = $.parsejson (Result);            $ ("# Projectinterfacegrid "). DataGrid (" LoadData ", Converdata); //Load data         }         })   }); 
Debug found that the first click on the record line, after the execution of the background SQL statement of the log printing, and then click, n times will not access the database and then print log records, but the Ajax success method is still executed, which gives me a feeling of loading the cache.

When I modify the "Project Interface Information List" record data in the database, click on the "Project information list" record line, the previous old data is still displayed, and the actual data of the database, and later found that the get type is modified to post mode, each click on the record row will be re-database query operation, Consistent with the actual data



--


No FAQ for Get and Post methods in jquery Ajax

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.