467,917 Members | 1,296 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,917 developers. It's quick & easy.

setAttribute("oncontextmenu","contextMenu(); return false;" -Doesn't work

I'm trying to change the <body> 's event oncontextmenu attributes, but
am having no luck at it.

I know I can do <body oncontextmenu="contextMenu(); return false;"> but
the thing is that I set's this attribute as soon as the page
loads......which I don't to happen....I don't want to the context menu
visible until the page is done loading, and within the window onLoad
event I have a vbscript subroutine that connects to a database to pull
some info into the html body....when the subroutine is done I want it
to set the oncontextmenu attribue for the body so that my custom
context menu will be shown. My context menu gives options like Email
Report, Print Report, Refresh Data, etc......but none of these
functions will work until the initial Onload subrotine is
finished.....so that's why I don't want the the custom context menu
shown at the beginning.

the script code I was trying to use for this is:

document.getElementById("body").setAttribute("onco ntextMenu","contextMenu();
return false;")

Jul 23 '05 #1
  • viewed: 3667
Share:
1 Reply
ItsMillerTime4u wrote:
I'm trying to change the <body> 's event oncontextmenu attributes, but
am having no luck at it.

I know I can do <body oncontextmenu="contextMenu(); return false;"> but
the thing is that I set's this attribute as soon as the page
loads......which I don't to happen....I don't want to the context menu
visible until the page is done loading, and within the window onLoad
event I have a vbscript subroutine that connects to a database to pull
some info into the html body....when the subroutine is done I want it
to set the oncontextmenu attribue for the body so that my custom
context menu will be shown. My context menu gives options like Email
Report, Print Report, Refresh Data, etc......but none of these
functions will work until the initial Onload subrotine is
finished.....so that's why I don't want the the custom context menu
shown at the beginning.

the script code I was trying to use for this is:

document.getElementById("body").setAttribute("onco ntextMenu","contextMenu();
return false;")


document.documentElement.oncontextMenu = contextMenu;

tested only in my mind......

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Savas Ates | last post: by
reply views Thread by Juna | last post: by
3 posts views Thread by jx2 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.