Programing with d o m
Picture of in Technology Dom Object Model of TECHNOLOGY DOM
Event (Event)
Event Driver
Event handler (Event Handler)
DHTML: HTML & CSS & JavaScript (VB) & DOM
Event handler example: 3 ways of shielding the menu that pops up on the web page
1. Add an event attribute on the HTML tab corresponding to the event source object, allowing the event attribute equal to the function name or program code that handles the event.
Function hideContextMenu ()
{
Window.Event.ReturnValue = false;
}
script>
// Event Attribute: OnContextMenu, which is equal to program function name HIDECONTextMenu
body>
2. Directly in the JavaScript code, set the object event properties of the elements, allow the event attribute value equal to the function name or program code that handles the event.
Function hideContextMenu ()
{
Return False;
}
Window.Document.οncοntextMenu = HIDECONTextMenu;
script>
And the difference between the way is that the setting event attribute is in the JavaScript code or in the HTML tag. If it is in the Script statement, then you need to add an event source. Document .onTextMenu (Event Attribute)