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