Recently look at other people's code, found that they like to use Dot to operate from inside the localstorage, rather than get setitem, remember said this before. Let's say it again.Use dot mode (each time with ' hello ' = ' world ', ' zhangsan ' = ' lisi ' as an example)' Lisi '; value:var value_of_hello_in_localstorage = Localstorage.hello; var value_of_zhangsan_in_localstorage = Localstorage.zhangsan Use GetItem SetItem to operateSet Value: Locals
Put a global variable inside the LocalstorageIssupport is true false;Window.localstorage Window.localStorage.setItem ("Webpsupport", Issupport);var issupport=window.localstorage Window.localStorage.getItem ("Webpsupport");Here the value of Issupport is the string "true", "false"If let true== "true" that is impossible, false== "false" is the same problemSo be sure to note that Localstorage will convert the values stored into a string type, the data t
Js:Appweb.jsfunction Savestorage (ID) {var target = document.getElementById (ID);var str = target.value;Ways to save Data key valueSessionstorage.setitem ("message", str);//}//function Loadstorage (ID) {var target = document.getElementById (ID);Reading datavar msg = Sessionstorage.getitem ("message");target.innerhtml = msg;//}The value stores the information that the webpage does not close, the webpage disappears at the closefunction Savestorage (ID) {var target = document.getElementById (ID);va
Instance: Refresh value will grow, turn off browser, then open, value will grow on original basisif (localstorage.pagecount) { localstorage.pagecount=number (localstorage.pagecount) +1;} Else { localstorage.pagecount=1;} document.write (localstorage.pagecount);Two ways to set and take values:1. Operation Dot= ' World '= ' lisi '; Value:var value_of_hello_in_localstorage = Localstorage.hello; var value_of_zhangsan_in_localstorage = Localstorage.zhangsan2. Get SetItemSet values: Localstorage
data.XMLDocument gets the XML reference.Method:GetAttribute () Gets the specified property value.Load (object) Loads the stored object data from the UserData store.RemoveAttribute () Removes the specified property from the object.Save object data is stored in an UserData store.SetAttribute () Sets the specified property value.LocalstorageMethod:Localstorage.getitem (Key): Gets the value that is stored locally by the specified keyLocalstorage.setitem (key,value): Store value in the key fieldLoca
= Utils.getparam ("ShoppingCart");
var jsonstr = Json.parse (Shoppingcart.substr (1,shoppingcart.length));
var productlist = jsonstr.productlist;
var result=false;
For (var i in productlist) {
if (productlist[i].id==product.id) {
result = true;
}
}
return result;
},
//delete items in cart
Deleteproduct:function (ID) {
var ShoppingCart = Utils.getparam ("ShoppingCart");
var jsonstr = Json.parse (Shoppingcart.substr (1,shoppingcart.length));
var productlist
the data * * * * *****************************/1 sys.localStorage.removeItem ("ItemName");parameter is the name of the field when writing/***************************** Write json file demo*************************************/1 varBaselocaldata = {};2 /*3 * Write data, store the data locally4 * @param jsonname:json file name5 */6 varBasedata = [{a:1},{b:2},{c:3},{d:4},{e:5},{f:6},{g:7}];7Baselocaldata.setitem =function(Jsonname)8 {9 varBasedata =json.stringify (jsonname);TenSys.localStorag
JQuery plug-in development and jQuery. extend function details are different from jQuery. fn and jQuery. prototype. jquery. fn. extendI. jQuery plug-in development is divided into two types:1. class level:You can understand the cl
This refers to the native JS Dom object. CSS (""): Write only one value is value, write two values is assignmentWindow.onload = = = $ (document). Ready ();$ (""): Gets the element tag name,. Class name, #idJQuery features
Chained programming
Jq.shou (in). HTML (content)
Equivalent
Jq.shou (3000)
jq.gtml (content)
Implicit iteration
Implicit practical for loop, iterationHow to use
In HTML5, localstorage is a good thing. In browsers that support localstorage, You can persistently input user forms. Even if you close the browser, you can read the value of localstorage when you access the browser again, this is a very good thing. Next we will introduce some examples. For more information, see "localstorage
information. Here's an example:data-options= ' {' name ': ' John '} ' >In order to access the data you need to call the following code:$ ("#d1"). Data ("role"); "Page"$ ("#d1"). Data ("Lastvalue"); 43$ ("#d1"). Data ("hidden"); True$ ("#d1"). Data ("Options"). Name; "John";If you want to see the actual example, please refer to this tutorial: using HTML5 and jquery plugin quicksand to achieve a cool StarCraft 2 class display effectjquery document for
I. Overview of JQueryJavaScript Class Library-JavaScript libraries appear to simplify the development of JavaScript-The JavaScript class library encapsulates predefined objects and useful functions that help developers build rich client pages with WEB 2.0 features that are highly difficult to interact with, and are compatible with large browsers-JavaScript libraries can be referred to as JS Library-The currently popular JavaScript libraries are:-JQuery
JQuery framework-3. jQuery custom encapsulation plug-ins and third-party plug-ins, jquery-3.jqueryI. jQuery encapsulation Extension1. Use the extend method in jQuery
(Hanging on jQuery and jQu
overlay class, for example, the pop-up effect that we commonly use. Although the forced object-oriented design of mootools somewhat fades away some of the beautiful features of JavaScript language itself. However, when the project is huge and JavaScript code is huge, this object-oriented design concept is quite useful. The larger the project, the more code we save.
Cookie read/writeThe mootools framework provides a cookie-based read/write method and supports specifying the domain and path. In t
Coda popup bubblesDeveloped Using jquery. It is similar to the "bubble" pop-up box.Home: http://jqueryfordesigners.com/coda-popup-bubbles/Download: http://jqueryfordesigners.com/coda-popup-bubbles/ (not found)Example: http://jqueryfordesigners.com/demo/coda-bubble.html
Simple effects pluginsThe jquery special effect plugin can be used to hide, hide, display, fade in/out, and slide up/down.Home: http://www.l
JQuery-1.9.1 source code analysis series (14) Some jQuery tools, jquery-1.9.1jquery
To prepare for the next chapter of analysis animation processing, let's take a look at some tools. Queue tools are often used in animation processing.
JQuery. fn. queue ([queueName] [, newQueue]) | ([queueName,]CallBack ))(Gets or sets
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.