°³Ã¼ÀÇ À¯Áö(persist) µ¥ÀÌÅÍ¿¡ ºê¶ó¿ìÀúÀÇ ¹æ¹®±â·ÏÀ» °¡´ÉÇÏ°ÔÇÑ´Ù.
script | object.style.behavior="url('#default#saveHistory')"; | |
---|---|---|
object.addBehavior("#default#saveHistory"); | ||
HTML | <ELEMENT style="behavior:url('#default#saveHistory')" id=idVal> | |
XML | <prefix:CustomTag id=idVal style="behavior:url('#default#saveHistory')" /> |
prefix | CustomTag°ú ¿¬°üµÈ XML namespace Á¢µÎ¾îÀÌ´Ù. HTML ű׿¡¼ xmlns ¾ÖÆ®¸®ºäÆ®·Î ¼³Á¤ÇÑ´Ù. |
CustomTag | ÀÛ¼ºÀÚ°¡ Á¤ÀÇÇÏ¿© »ç¿ëÇϴ ű×ÀÌ´Ù. |
idVal | °³Ã¼À» ´ëÇ¥ÇÏ´Â À¯ÀÏÇÑ ÀνÄÀÚ ¹®ÀÚ¿ÀÌ´Ù. |
saveHistory ºñÇìÀ̹ö´Â »ç¿ëÀÚ°¡ ÆäÀÌÁö·ÎºÎÅÍ ´Ù¸¥ °÷À¸·Î Ç×ÇØÇÒ ¶§ ÇöÀç ÆäÀÌÁöÀÇ »óŸ¦ ÀúÀåÇÑ´Ù.
»ç¿ëÀÚ°¡ ±× ÆäÀÌÁö·Î µ¹¾Æ¿À±â À§Çؼ µÚ·Î³ª ¾ÕÀ¸·Î ´ÜÃ߸¦ Ŭ¸¯Çϸé ÀúÀåµÇ¾ú´ø °ªÀÌ È¸º¹(restore)µÈ´Ù.
saveHistory ºñÇìÀ̹ö´Â ÇöÀçÀÇ ¼¼¼Ç¿¡¼¸¸ À¯Áö(persist)ÇÑ´Ù. saveHistory ºñÇìÀ̹ö¸¦ °®´Â ÆäÀÌÁö·ÎºÎÅÍ »ç¿ëÀÚ°¡ ÆäÀÌÁö·ÎºÎÅÍ ´Ù¸¥ °÷À¸·Î Ç×ÇØÇϸé, »ç¿ëÀÚ µ¥ÀÌÅÍ(UserData) ÀúÀåÀ§Ä¡¿¡ ±× µ¥ÀÌÅÍ°¡ À¯ÁöµÈ´Ù. saveHistory ºñÇìÀ̹ö´Â Àüü ¹®¼ÀÇ »ç¿ëÀÚ µ¥ÀÌÅÍ(UserData) ÀúÀåÀ» »ç¿ëÇϹǷΠµÎ°³ÀÇ ¿¤·¹¸àÆ®¿¡ °°Àº ¾ÖÆ®¸®ºäÆ®¸¦ ±â¼úÇÏ¸é µÚ ±â¼ú¿¡ ÀÇÇÏ¿© ¾ÕÀÇ °ÍÀÌ µ¤¾î¾º¿öÁø´Ù. »ç¿ëÀÚ µ¥ÀÌÅÍ(UserData) ÀúÀåÀº µð½ºÅ©¿¡ ÀúÀåµÇÁö ¾Ê°í ¸Þ¸ð¸® È帧(in-memory stream)¿¡ ÀúÀåµÇ¹Ç·Î, ºê¶ó¿ìÀú°¡ ´Ý°ÜÁö¸é ±â·ÏÀÌ ³²Áö ¾Ê´Â´Ù.
¿¹¸¦µé¾î ÆäÀÌÁö¿¡¼ ¿©·¯ ź·ÂÀûÀ¸·Î ¾÷µ¥ÀÌÆ®µÈ ½ºÂ÷ÀϵéÀ» °¡Áö¸é ÀÌµé ¾÷µ¥ÀÌÆ®µÈ ³»¿ëÀ» onload¿Í onsave À̺¥Æ®Ã³¸®ÀÚ·Î ÀúÀåÇϰųª Àд´Ù. ½ºÅ¸¸±°ªµéÀº onsave À̺¥Æ®°¡ ¹ß»ýµÇ¸é ÀúÀåµÇ°í, onload À̺¥Æ®°¡ ¹ß»ýµÇ¸é ȸº¹µÈ´Ù.
saveHistory ºñÇìÀ̹öÀ» »ç¿ëÇϱâ À§ÇÏ¿©, meta ű׷ΠÀ¯Áö Çü½ÄÀÇ ÀνÄÀÚ¸¦ ±â¼úÇÑ´Ù.
<META name="save" content="history">
ÇÊ¿äÇÑ styleÀº ÀζóÀÎÀ̳ª ¹®¼ÀÇ head ºÎºÐ¿¡ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.
<STYLE>.historyClass {behavior:url(#default#saveHistory);}</STYLE>
id ¼Ó¼ºÀº ¼±ÅÃÀûÀÌÁö¸¸ À¯Áö¸¦ ¿Ã¹Ù¸£°Ô Çϱâ À§Çؼ´Â id°¡ ÇÊ¿äÇÏ´Ù.
saveHistory ºñÇìÀ̹ö´Â IE5ÀÇ Win32¿Í Unix Ç÷§Æ®Æû¿¡¼ Áö¿øµÈ´Ù.
attribute | property | ¼³¸í |
---|---|---|
XMLDocument | XMLDocument | °³Ã¼¿¡ ¹Ý¿µµÈ XML DOM(Document Object Model)ÀÇ ÂüÁ¶¸¦ ¹ÝȯÇÑ´Ù. |
¸Þ¼µå | ¼³¸í |
---|---|
getAttribute | ÁöÁ¤µÈ ¾ÖÆ®¸®ºäÆ®ÀÇ °ªÀ» ¹ÝȯÇÑ´Ù. |
removeAttribute | ÁöÁ¤µÈ ¾ÖÆ®¸®ºäÆ®¸¦ Á¦°ÅÇÑ´Ù. |
setAttribute | ÁöÁ¤µÈ ¾ÖÆ®¸®ºäÆ®ÀÇ °ªÀ» ¼³Á¤ÇÑ´Ù. |
À̺¥Æ® | ¼³¸í |
---|---|
onload | ÆäÀÌÁö°¡ ´Ù½Ã ·ÎµùµÇ¸é À¯Áö(persistent) ¿¤·¹¸àÆ®·ÎºÎÅÍ ¹ß»ýÇÑ´Ù. |
onsave | À¥ÆäÀÌÁö°¡ ÀúÀåµÇ°Å³ª ºÏ¸¶Å©(bookmark)µÇ°Å³ª »ç¿ëÀÚ°¡ ºê¶ó¿ìÀú·Î ÆäÀÌÁö·ÎºÎÅÍ ´Ù¸¥°÷À¸·Î Ç×ÇØÇϸé À¯Áö(persistent) ¿¤·¹¸àÆ®·ÎºÎÅÍ ¹ß»ýÇÑ´Ù. |
°³Ã¼ | IE |
---|---|
<ELEMENT style="behavior:url('#default#saveHistory')" id=idVal> | IE5(win32,unix) |
A ACRONYM ADDRESS AREA B BIG BLOCKQUOTE BUTTON CAPTION 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=password INPUT type=radio INPUT type=reset INPUT type=submit INPUT type=text KBD LABEL LI LISTING MAP MARQUEE MENU OBJECT OL OPTION P plainText PRE Q S SAMP SELECT SMALL SPAN STRIKE STRONG SUB SUP TABLE TEXTAREA TT U UL VAR XMP |
<BUTTON onclick="window.open('../behavior/exp/wsaveHistory.html','_new','width=500,height=300')">¿¹Á¦ º¸Á¶Ã¢ ¿±â</BUTTON>
exp/wsaveHistory.html ÄÚµå
<!DOCTYPE html public "-//w3c//dtd html 4//en">
<HTML>
<HEAD>
<TITLE>¾ð¾î ÂüÁ¶ - Javascript - ºñÇìºñ¾î(behavior) - saveHistory ¿¹Á¦</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=euc-kr">
<LINK rel="stylesheet" type="text/css" href="../../public/jscript.css">
<META name="save" content="history">
<STYLE>.sHistory {behavior:url(#default#saveHistory);}</STYLE>
<SCRIPT>
function doSave(){
message='ÀÔ·ÂÇÏ°í ÁøÇàÇ϶ó.';
if (oPersistForm.oPersistText.value) document.location='../../public/blank.html';
else {
alert(message);
oPersistForm.oPersistText.focus();
return false;
}
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE width=500>
<TR><TD>
<DIV style="border:solid 1 blue;background:fff;text-align:center;width:100%;margin:5">
<H3><SPAN class=titleblue><SPAN class=behavior>saveHistory</SPAN> ¿¹Á¦</SPAN></H3>
</DIV>
<SPAN class=gray><SCRIPT>document.write(document.location)</SCRIPT></SPAN><BR><BR>
<FORM name="oPersistForm">
Á¤º¸ ÀÔ·Â 1: <INPUT type=text id="oPersistText" class=sHistory>(À¯ÁöµÈ´Ù.)<BR>
Á¤º¸ ÀÔ·Â 2: <INPUT type=text id="oPersistNone">(À¯ÁöµÇÁö ¾Ê´Â´Ù.)
</FORM><BR>
<P align=center style="background:ffa;padding:10">ÀÔ·ÂÇÑ ÈÄ
<BUTTON onClick="doSave()"
style="background:aff;padding:1;font-size:.9em"><B>¿©±â¸¦ Ŭ¸¯</B></BUTTON>ÇÏ°í ´Ù½Ã µ¹¾Æ¿Í º¸¶ó.</P><BR>
<TABLE cellpadding=8 align=center style="border:solid 1 blue">
<TR><TD align=center><BUTTON onClick="self.close()">ÇöÀç º¸Á¶Ã¢ ´Ý±â</BUTTON></TD></TR>
</TABLE>
</TD></TR></TABLE>
</BODY>
</HTML>
../../public/blank.html ÄÚµå
<!DOCTYPE html public "-//w3c//dtd html 4//en">
<HTML>
<HEAD>
<TITLE>ºó ÆäÀÌÁö</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=EUC-KR">
<LINK rel="stylesheet" type="text/css" href="../public/jscript.css">
</HEAD>
<BODY>
<CENTER>
<BR><BR><BR>
<H3>ºó ÆäÀÌÁö</H3><BR><BR>
<A href="Javascript:history.go(-1)"><IMG src="../../gif/arbackv.gif" border=0 alt="ÀÌÀü ÆäÀÌÁö·Î"></A>
<A href="Javascript:history.back()">ÀÌÀü ÆäÀÌÁö·Î</A>
<BR><BR><BR>
<SPAN class=mini><SPAN class=teal>ÀÌ ÆäÀÌÁö´Â <SCRIPT>document.write(document.location)</SCRIPT> ÀÓ</SPAN></SPAN>
</CENTER>
</BODY>
</HTML>