Built-in behavior has application: Savefavorite article
"Savefavorite" is a very useful built-in behavior: When a visitor adds your Web page to the Favorites folder, "Savefavorite" saves the relevant data on the page: The next time a visitor starts the page from "Favorites," Automatically reverts to the state of the store. And these actions, are done on the client, do not have to use the server, but also do not need "Cookies"!
"Savefavorite" uses two built-in methods, "Getattrib" and "setattribute", to access data. There are two events, "OnSave" (stored to Favorites) and "onload" (open pages from Favorites).
In the <meta name= "Save" Content=favorite ">
</title>xmllover</title>
<style>
. Saveit{behavior:url (#ddefault #savefavorite)}
</style>
<script>
function Save_data ()
{Page1.setattribute ("old_value,page.value);}
function Load_data ()
{Page1.value=page.getattribute ("Old_value");}
</script>
<body>
I'm xmllover who I'm afraid of.
<input class= "SaveIt" onsave= "Save_data ()" onload= "Load_data ()" type= "text" id= "Page1" >
</body>
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