JavaScript DHTML/Javascript Objects/Window External
Содержание
Add Favorite
<html>
<head>
<script language="JavaScript">
function function1() {
window.external.AddFavorite("http://www.wbex.ru");
}
</script></head>
<body>
<button onclick="function1();">
Click here to add www.wbex.ru main page to your favorites
</button>
</body>
</html>
"AutoCompleteSaveForm()" Example
<html>
<body>
<form name="myForm">
First Name: <input type="text" name="firstName"><br>
Last Name: <input type="text" name="lastName" autocomplete="off">
</form>
<script language="JavaScript">
function function1(){
window.external.AutoCompleteSaveForm(document.forms[0]);
myForm.firstName.value="";
myForm.lastName.value="";
}
</script>
<button onclick="function1();">Save</button>
</body>
</html>
"AutoScan()" Example
<html>
<head>
<script language="JavaScript">
function function1() {
window.external.AutoScan("wbex", "index.htm");
}
</script>
</head>
<body>
<button onclick="function1();">Open wbex.ru site</button>
</body>
</html>
"ImportExportFavorites()" Example
<html>
<body>
<script language="JavaScript">
function function1() {
window.external.ImportExportFavorites(true, "");
}
</script>
<button onclick="function1();">Show dialog</button>
</body>
</html>
"IsSubscribed()" Example
<html>
<body>
<script>
window.external.IsSubscribed("http://yourdomain/yourcdffile.cdf");
</script>
</body>
</html>
<html>
<body>
<script language = "JavaScript">
var yourWindow = window.external.menuArguments;
var theDocument = yourWindow.document;
</script>
</body>
</html>
<html>
<head>
<script language="JavaScript">
function function1() {
window.external.NavigateAndFind("http://www.wbex.ru", "Java", "");
}
</script>
</head>
<body>
<input id=myB type="button" value="Navigate and Find" onclick="function1();">
Go
</body>
</html>
Open new window and write user text
<html>
<head>
<script type="text/javascript">
function showBox() {
userText = "My own browser text";
if (userText != null) {
userWindow = window.open("", "userTextWindow", "toolbar=0,width=200,height=200");
userWindow.document.write(userText);
userWindow.document.close();
}
}
</script>
</head>
<body>
<form action="null" method="post">
<input type="button" value="Go!" onclick="showBox()" />
</form>
</body>
</html>