亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

HTML5 ? ???

HTML5 ? ???

HTML5 ? ???? ???? ? ?? ?? ?? ?????.

HTML5 ? ????? ??????

HTML5? ???? ???? ?? ???? ??? ??? ? ????.

???? ?? ????? ??? ??????. ??? ? ????? ?? ???? ??? ???. ???? ??? ???? ??? ???? ???? ???? ??? ?? ???? ?????. ?? ???? ??? ??? ?? ?? ?? ?? ???? ??? ?? ????.

???? ?/? ??? ????, ????? ???? ?? ??????? ???? ??? ? ????.

localStorage ? sessionStorage

?????? ???? ???? ?? ? ?? ??? ??? ????.

localStorage - ?? ?? ?? ??? ??

sessionStorage - ???? ?? ??

? ???? ???? ?? ????? localStorage ? sessionStorage? ????? ???? ???:

if(typeof(Storage)!=="undefined")
  {
  // Yes! localStorage and sessionStorage support!
  // Some code.....
  }
else
  {
  // Sorry! No web storage support..
  }

localStorage ??

???? ????? ?? ??? ????. localStorage ??? ??. ???? ?? ?, ?? ? ?? ?? ???? ?? ??? ? ????.

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
</head>
<body>
<div id="result"></div>
<script>
if(typeof(Storage)!=="undefined")
  {
  localStorage.lastname="Smith";
  document.getElementById("result").innerHTML="Last name: " + localStorage.lastname;
  }
else
  {
  document.getElementById("result").innerHTML="Sorry, your browser does not support web storage...";
  }
</script>
</body>
</html>

?? ?:

key="lastname" ? value="Smith"? ???? localStorage ?/? ? ??

? ? " lastname" ?? ?? id="result"

? ??? ???? ?????. ?: ?/? ?? ????? ???? ???? ??? ?? ? ??? ??? ? ????.

?? ???? ???? ??? ??? ??? ?????. ??? ??? ?? ?? ???? ?????.

<!DOCTYPE html>
<html>
<head>
<script>
function clickCounter()
{
if(typeof(Storage)!=="undefined")
  {
  if (localStorage.clickcount)
    {
    localStorage.clickcount=Number(localStorage.clickcount)+1;
    }
  else
    {
    localStorage.clickcount=1;
    }
  document.getElementById("result").innerHTML="You have clicked the button " + localStorage.clickcount + " time(s).";
  }
else
  {
  document.getElementById("result").innerHTML="Sorry, your browser does not support web storage...";
  }
}
</script>
</head>
<body>
<p><button onclick="clickCounter()" type="button">點(diǎn)我</button></p>
<div id="result"></div>
<p>單擊該按鈕查看計(jì)數(shù)器增加.</p>
<p>關(guān)閉瀏覽器選項(xiàng)卡(或窗口),再試一次,計(jì)數(shù)器將繼續(xù)計(jì)數(shù)(不是重置)。</p>
</body>
</html>

sessionStorage ??

sessionStorage ???? ?? ??? ?? ???? ?????. ???? ???? ?? ??? ???? ?????.

sessionStorage? ??? ????? ??: :

<!DOCTYPE html>
<html>
<head>
<script>
function clickCounter()
{
if(typeof(Storage)!=="undefined")
  {
  if (sessionStorage.clickcount)
    {
    sessionStorage.clickcount=Number(sessionStorage.clickcount)+1;
    }
  else
    {
    sessionStorage.clickcount=1;
    }
  document.getElementById("result").innerHTML="You have clicked the button " + sessionStorage.clickcount + " time(s) in this session.";
  }
else
  {
  document.getElementById("result").innerHTML="Sorry, your browser does not support web storage...";
  }
}
</script>
</head>
<body>
<p><button onclick="clickCounter()" type="button">Click me!</button></p>
<div id="result"></div>
<p>單擊該按鈕查看計(jì)數(shù)器增加.</p>
<p>關(guān)閉瀏覽器選項(xiàng)卡(或窗口),再試一次,計(jì)數(shù)器將繼續(xù)計(jì)數(shù)(不是重置)。</p>
</body>
</html>


???? ??
||
<!DOCTYPE html> <html> <head> <script> function clickCounter() { if(typeof(Storage)!=="undefined") { if (localStorage.clickcount) { localStorage.clickcount=Number(localStorage.clickcount)+1; } else { localStorage.clickcount=1; } document.getElementById("result").innerHTML="You have clicked the button " + localStorage.clickcount + " time(s)."; } else { document.getElementById("result").innerHTML="Sorry, your browser does not support web storage..."; } } </script> </head> <body> <p><button onclick="clickCounter()" type="button">點(diǎn)我</button></p> <div id="result"></div> <p>單擊該按鈕查看計(jì)數(shù)器增加.</p> <p>關(guān)閉瀏覽器選項(xiàng)卡(或窗口),再試一次,計(jì)數(shù)器將繼續(xù)計(jì)數(shù)(不是重置)。</p> </body> </html>