home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _IEHeadInsertEventScript.au3 < prev    next >
Encoding:
Text File  |  2006-07-14  |  1.0 KB  |  21 lines

  1. ; *******************************************************
  2. ; Example 1 - Open a browser with the basic example page, insert an
  3. ;                event script into the head of the document that creates
  4. ;                a JavaScript alert when someone clicks on the document
  5. ; *******************************************************
  6. ;
  7. #include <IE.au3>
  8. $oIE = _IE_Example ("basic")
  9. _IEHeadInsertEventScript ($oIE, "document", "onclick", "alert('Someone clicked the document!');")
  10.  
  11. ; *******************************************************
  12. ; Example 2 - Open a browser with the basic example page, insert an
  13. ;                event script into the head of the document that creates
  14. ;                a JavaScript alert when someone tries to right-click on the
  15. ;                document and then the event script returns "false" to prevent
  16. ;                the right-click context menu from appearing
  17. ; *******************************************************
  18. ;
  19. #include <IE.au3>
  20. $oIE = _IE_Example ("basic")
  21. _IEHeadInsertEventScript ($oIE, "document", "oncontextmenu", "alert('No Context Menu');return false")