JavaScript Reference/Javascript Methods/execCommand

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"execCommand()" Example

   <source lang="javascript">
   

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

   document.execCommand("Refresh", "false", "false");

} </script> <button onclick="function1();">Refresh page</button> </body> </html>


     </source>
   
  


"execCommand()" is applied to

   <source lang="javascript">

Names noted with an asterisk (*) are JavaScript properties only. +----------------+--------------------------------------------------------------+ | Applied_To |controlRange* document | | |TextRange | +----------------+--------------------------------------------------------------+

     </source>
   
  


"execCommand()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Executes outside the regular methods. Returns true (successful) or false (failed).

Syntax:

controlRangeName.execCommand(param1, param2, param3) objectName.execCommand(param1, param2, param3)

Parameters:

   param1   Required; the name of the command. 
            see http://msdn.microsoft.ru/workshop/author/dhtml/reference/commandids.asp.
   param2   Optional; true or false, display a user interface 
                      if the command supports one.
   param3   Optional; only applies to some of the commands.
   
     
     </source>