JavaScript DHTML/Javascript Objects/Window External

Материал из Web эксперт
Перейти к: навигация, поиск

Add Favorite

   <source lang="html4strict">

   

<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>


 </source>
   
  


"AutoCompleteSaveForm()" Example

   <source lang="html4strict">

   

<html> <body> <form name="myForm">

   First Name: <input type="text" name="firstName">
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>


 </source>
   
  


"AutoScan()" Example

   <source lang="html4strict">

   

<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>


 </source>
   
  


"ImportExportFavorites()" Example

   <source lang="html4strict">

   

<html> <body> <script language="JavaScript"> function function1() {

   window.external.ImportExportFavorites(true, "");

} </script> <button onclick="function1();">Show dialog</button> </body> </html>


 </source>
   
  


"IsSubscribed()" Example

   <source lang="html4strict">

   

<html> <body> <script> window.external.IsSubscribed("http://yourdomain/yourcdffile.cdf"); </script> </body> </html>


 </source>
   
  


"menuArguments" Example

   <source lang="html4strict">

   

<html> <body> <script language = "JavaScript">

   var yourWindow = window.external.menuArguments;
   var theDocument = yourWindow.document;

</script> </body> </html>


 </source>
   
  


Navigate And Find

   <source lang="html4strict">

   

<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>


 </source>
   
  


Open new window and write user text

   <source lang="html4strict">
 

<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>


 </source>