最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

saveSnapshot Behavior

Internet Development Index

Enables the object to persist data when a Web page is saved.

Syntax

XML <Prefix: CustomTag ID=sID STYLE="behavior:url('#default#saveSnapshot')" />
HTML <ELEMENT STYLE="behavior:url('#default#saveSnapshot')" ID=sID>
Scriptingobject.style.behavior = "url('#default#saveSnapshot')"
object.addBehavior ("#default#saveSnapshot")

Possible Values

PrefixPrefix that associates the CustomTag with an XML namespace. This prefix is set using the XMLNS attribute of the HTML tag.
CustomTagUser-defined tag.
sIDString that specifies a unique identifier for the object.

Members Table

EventDescription
onsave Fires from a persisted element when the Web page is saved or bookmarked, or when the user navigates away from the page.

Remarks

The saveSnapshot behavior can persist form values, styles, dynamically updated content, and scripting variables when the user saves a Web page locally as Web Page, HTML Only.

security note Security Alert  Using this behavior incorrectly can compromise the security of your application. This behavior persists data as plain text in a saved Web page. Text is not encrypted and therefore not secure. Any application that has access to the drive where the page is saved has access to the data and can tamper with it. Therefore, it is recommended that you not persist sensitive data like credit card numbers. For more information, see Security Considerations: DHTML and Default Behaviors.

The saveSnapshot behavior cannot persist the body element and individual table elements, such as rows and cells.

The saveSnapshot behavior can persist the content of the script element if the element is assigned an ID and a CLASS. The saveSnapshot behavior can persist only string, Boolean, and integer variants. Comments, functions, and scripting objects, such as arrays, are stripped out. Persistent script elements with an external source write the variables into the persistent page from the source.

To use the saveSnapshot behavior, use a meta tag that identifies the type of persistence.

   <META NAME="save" CONTENT="snapshot">

The required style may be set inline or in the document header, as follows:

   <STYLE>
.sSnapshot {behavior:url(#default#savesnapshot);}
</STYLE>

An ID is required for the object to persist correctly.

The saveSnapshot behavior is available as of Microsoft® Internet Explorer 5, in the Microsoft Win32® and Unix platforms.

Examples

The following examples show how to use the saveSnapshot behavior.

This example uses the saveSnapshot behavior to persist form data.

<HTML>
<HEAD>
<META NAME="save" CONTENT="history">
<STYLE>
.sSnapshot {behavior:url(#default#savesnapshot);}
</STYLE>
</HEAD>
<BODY>
<INPUT class=sSnapshot type=text id=oPersistInput>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

This example uses the saveSnapshot behavior to persist an entire form in two ways: by setting the CLASS attribute of the input fields to "saveSnapshot", and by packaging the data into a string variable, sData, when the user clicks the Save From Data button.

<HTML>
<HEAD>
<META NAME="save" CONTENT="snapshot">
<STYLE>
.sSnapshot {behavior:url(#default#savesnapshot);}
</STYLE>
<SCRIPT CLASS="sSnapshot" id=oPersistScript>
var sData="";
</SCRIPT>
<SCRIPT>
function PersistArray(){
var sData="";
for(var i=0;i<oPersistForm.elements.length;i++){
if(oPersistForm.elements[i].type == "text"){
sData+=oPersistForm.elements[i].value + "|";
oPersistForm.elements[i].value="";
}
if(oPersistForm.elements[i].tagName == "SELECT"){
sData+="spamtype=" + oPersistForm.elements[i].selectedIndex;
oPersistForm.oSelSpam.selected=-1;
}
}
sPersistData=sData;
}
function RestoreArray(){
if(sPersistData!="~Empty~"){
collData=sPersistData.split("|");
for(var i=0;i<collData.length;i++){
if(collData[i].indexOf("spamtype=")==-1){
oPersistForm.elements[i].value=collData[i];
}
if(collData[i].indexOf("spamtype=")>=0){
oPersistForm.oSelSpam.selectedIndex=
collData[i].substring(
collData[i].indexOf("=")+1,collData[i].length
);
}
}
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM ID="oPersistForm">
<TABLE CLASS="oSampleStyle">
<TR><TD><LABEL FOR="oFirstName">First Name:</LABEL></TD>
<TD><INPUT CLASS="sSnapshot" TYPE="text" ID="oFirstName" SIZE=15></TD></TR>
<TR><TD><LABEL FOR="oSelSpam">Select Method of Spam:</LABEL></TD>
<TD>
<SELECT ID="oSelSpam">
<OPTION>E-mail<OPTION>Postal Mail<OPTION>Telemarketing
</SELECT></TD></TR>
:
</TABLE>
<INPUT TYPE="button"
VALUE="Save form data in script"
onclick="PersistArray()"
>
<INPUT TYPE="button"
VALUE="Restore data from script"
onclick="RestoreArray()"
>
</FORM>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Applies To

A, ACRONYM, ADDRESS, AREA, B, BIG, BLOCKQUOTE, BUTTON, CENTER, CITE, CODE, DD, DEL, DFN, DIR, DIV, DL, DT, EM, FONT, FORM, hn, HR, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LI, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, XMP

See Also

Introduction to DHTML Behaviors, Introduction to Persistence
巢湖市| 洪洞县| 靖州| 略阳县| 股票| 建阳市| 衡阳县| 五家渠市| 巴南区| 桦川县| 望江县| 乐安县| 莲花县| 安溪县| 宁海县| 云安县| 秀山| 伊金霍洛旗| 亳州市| 新巴尔虎右旗| 盐城市| 略阳县| 六盘水市| 长武县| 子长县| 乌审旗| 佛山市| 米易县| 连江县| 边坝县| 交口县| 上饶市| 惠州市| 溧水县| 和政县| 沂水县| 赣榆县| 越西县| 桃园市| 册亨县| 澳门|