homeandpersist.htm

来自「Windows Web脚本开发指南/(美) Dan Heflin, Todd N」· HTM 代码 · 共 70 行

HTM
70
字号
<html XMLNS:HP>

<head>
<META NAME="save" CONTENT="history">
<META NAME="save" CONTENT="favorite">
<title>homePage, saveHistory and saveFavorite Demo</title>
<STYLE>
   .saveHistory {behavior:url(#default#savehistory);}
   .saveFavorite {behavior:url(#default#savefavorite);}
</STYLE>

<script language="JavaScript">
function isHomePage(){
var bolHomePage;

	bolHomePage = objHomePage.isHomePage(document.all.sURL.value);
	if (bolHomePage)
		alert(document.all.sURL.value + " is your home page.");
	else
		alert(document.all.sURL.value + " is not your home page.");
}
function displayHomePage(){

	objHomePage.navigateHomePage();
}
function setHomePage(){

	objHomePage.setHomePage(document.all.sURL.value);
}

</script>

</head>

<body bgcolor="#FFFFCC">
<HP:homePage id="objHomePage" style="behavior:url(#default#homepage)" />
<p align="center"><font size="5">homePage, saveHistory and saveFavorite Demo<br>
<br>
</font></p>
<form >
 <font size="5">homePage Default Behavior</font>
 <br>
 Enter a url in the textbox below:
  <table border="0" width="101%">
    <tr>
      <td width="49%"><input type="text" id="sURL" size="71"></td>
    </tr>
  </table>
 <table border="0" width="98">
  <tr>
    <td width="26%" align="center"><input onclick="isHomePage()" type="button" value="Is Home Page" name="btnIsHomePage"></td>
    <td width="38%" align="center"><input onclick="displayHomePage()" type="button" value="Display Home Page" name="btnDisplayHomePage"></td>
    <td width="36%" align="center"><input onclick="setHomePage()" type="button" value="Set New Home Page" name="btnSetHomePage"></td>
  </tr>
 </table>
  <br>
 <font size="5">saveHistory Default Behavior</font>
 <br> Enter some data in the textbox below. It will persist for this session only.
 <br><input type="text" class="saveHistory" name="txtHistory" size="62"> 
 <p><font size="5">saveFavitore Default Behavior</font>
 <br> Enter some data in the textbox below. It will persist between sessions
 when this page<br>
 saved as a favorite.
 <br><input type="text" class="saveFavorite" name="txtFavorite" size="62"> 
</form>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?