472,799 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,799 software developers and data experts.

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
1 3851
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Savas Ates | last post by:
CREATE PROCEDURE st_deneme @userid numeric (18) ,@result numeric (18) output AS select * from users return "10" GO **************************** <!--METADATA TYPE="typelib" NAME="Microsoft...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
1
by: Station Media | last post by:
Hi, here my problem, i use stored procedure in ACCESS database(latest version), and i would like to use this procedure but it doesnt work, do you know why ? Procedure: PARAMETERS MyField Text...
3
by: Clouds | last post by:
Hi ! How do I add the dynamic event handler for a dropdownlist present in the itemtemplate of a datalist !! I am doing it in the itemdatabound event of the datalist but it doesnt work... I am...
0
by: Juna | last post by:
I have been working in vs2003, but now started to work in vs2005 but the problem, I have simple web application not website, which work i mean open in browser when we press F5 or run the...
1
Digital Don
by: Digital Don | last post by:
I am writing a program for Peg solitaire... To check for no repetition of previous states I use a Set for storage of Board states.. The pronblem is when I declare the set as type char i.e. set...
3
by: jx2 | last post by:
hi guys i would appriciate your coments on this code - when i ran it for the very first time it doesnt see @last = LAST_INSERT_ID() but when i ran it next time it read it properly i need to know it...
1
by: Dany13 | last post by:
hi all. i using some text box for input value and some localvarible for passing this data to dataset . give instance for correct row of dataset and data in data table . use one gird view for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.