Disabling the Context Menu - DHTML Lab - DHTML Diner | 4 | WebReference

Disabling the Context Menu - DHTML Lab - DHTML Diner | 4

DHTML Diner Logo

Disabling the Context Menu

Explorer for Windows

Explorer for Windows assigns context menus to Operating System object or component, not events within a browser. This is an oversimplification, of course, but should give you an idea why we cannot control the menu through event handling.

Explorer 4

In Explorer 4, there is no way to disable the context menu unless you turn your page into an Operating System object (COM object). The only way to do this is by defining your page as a DHTML Scriptlet, and loading it into another page using the OBJECT tag.

Scriptlet technology was introduced in Explorer 4, and after the initial hoopla, was ignored by further IE developments. Personally, I think Scriptlets are great, but for platform and browser-specific applications only.

And because they are OBJECTs, they can be viewed as hostile Active-X controls, even though they are innocent HTML pages, by high IE security settings.

To demonstrate the context menu behavior, the previous page of this article is inserted twice below. The first time into an IFRAME, the second as a Scriptlet using OBJECT.

These examples will only appear in Explorer. If you have a high security setting the second example may not appear: