Link to home
Start Free TrialLog in
Avatar of erenpasa
erenpasa

asked on

document.oncontext menu doesn't appear

Hi to all,
i want to show a context menu on body element. But i don't want any element in body element.
I've coded it but context menu event doesn't fired.
I attached my code. But as i say i don't want any element in <body></body> tag like div table etc...
if i add it so the event raise already.
i use internet explorer 7... ff or others not important for me for this subject..

<body>
</body>
<script language="javascript">
document.body.oncontextmenu=function (){alert("test")};
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of torimar
torimar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tested within Homesite+ which uses the IE dlls for preview.

However, since I never use IE for browsing, only the default IE 6 is installed. Sorry, didn't realize it explicitly had to work in IE 7.