• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using execCommand

The Internet Explorer actually supports more methods than are normally available through JavaScript, but you can reach many of them with the execCommand method of the document object. (Some commands are available only through ActiveX programming, for example.) This method works with the document, a current selection, or a text range. (We’ll see text ranges in Chapter 11.)

Here’s the syntax for this method: execCommand(Command [, UserInterface] [, Value]), where Command is a string that specifies the command to execute. UserInterface is a Boolean that you set to false (the default) if you do not want to display a user interface, and true if you do. Value is a string or number, or other value to assign. This method returns true if successful, false otherwise. You can see the possible commands to use in Table 9.6. (More commands are available, but they’re not yet supported by the Internet Explorer.)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint