1.get method is shown, after the URL will be followed by parameters, security is not good, but the higher performance of the Post method is implicit, high security. 2.get fetch or send data size is limited, generally less than 1KB post fetch or send data size unrestricted, generally 2m3.get way to take data to use QueryString Post method to take data to use Request.Form although both have a unified re Quest methods, but this affects efficiency, as little as possible. 4.get method will cache data post mode never cache data 5.Jquery implementation Ajax:
$.ajax ({
URL: ' Servicehandler.ashx ',
Data: [{name: ' key ', value: ' Download '}],
DataType: ' JSON ',
Type: ' Post ',//or in Get mode
Cache:false,
Async:false,
Error:function (e) {
},
Success:function (data) {
Deposit Storage
$.each (data. Menu, function (i, n) {
Localstorage.setitem ("M" + N.number, Json.stringify (n));
});
}
});
Xpos Project Experience Record:
1. Apply HTML5&CSS3 Pure foreground technology to realize the function of Web local storage and offline application.
2. Local storage mechanisms are now supported in mainstream browsers such as Chrome,safri,firefox,ie 11 or more Localstorage
Window.localStorage.setItem (",")
Window.localStorage.setItem (",")
3.web Offline application mechanism:
A. On the server that publishes the Web, add a file with the suffix. AppCache (for example, Xpos.appcache) to add the content to be cached in the file
CACHE MANIFEST
#要缓存的内容
Main.html
Javascripts/xpos.order.js
NETWORK
#不缓存的内容
B. On the IIS server, double-click the MIME types icon on the home page, then pop up the Add MIME Types dialog box, fill in ". AppCache" at extension, and fill in "Text/cache-manifest" at MIME
C. write in the homepage D. Every time the site updates, be sure to modify the Xpos.appcache file, you can add the updated version, because the cache file update mechanism is based on the update of the Xpos.appcache file to determine whether the site is updated.
E. Cache of various listener events:
var appCache = Window.applicationcache;
Window.addeventlistener (' online ', function () {appcache.update (); });
appcache.addeventlistener (' Cached ', function () { }); Appcache.addeventlistener (' Checking ', function () { }); Appcache.addeventlistener (' Downloading ', function () { }); Appcache.addeventlistener (' Error ', function () { }); appcache.addeventlistener (' Noupdate ', function () { }); Appcache.addeventlistener (' Updateready ', function () { if ( Confirm (' Server Web site has been updated, is it updated to local? ') { window.location.reload (); } Appcache.swapcache (); dataoperator.downloaddata (); dataoperator.showdata (); 3); During the development process, data interaction with WCF through Ajax is often the first or the first few times the data is loaded successfully. Failed to load later. Find out why, experience is as follows:
A. Because of the web off-line caching mechanism enabled, every time Ajax loads the data from the local cache file, the Ajax get mode is used, because the Get mode is cached, so it does not re-request data to the server, causing the data load to fail.
B. After changing to Ajax post, the data never cache, so each time the site is refreshed, the data is requested from the service.
A simple understanding of the differences between AJAX get and post and web offline applications