473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

innerHTML javascript events not firing

teb
Hello all,

Here is basically the situation. I have an empty div on my page.
When I mouseover a word, the innerHTML of the div gets written with a
table. The td elements all have onclick, onmouseover, etc. events.
When I mouseover a word, the div appears, but none of the events fire
until another event occurs. For example, if I put in an alert box or
I right click, and then mouseover the div, the td events then work.
Keep in mind that the div is basically acting as a menu. So the
sequence of events that I'm seeing are as follows: mouse over a word,
div appears but none of the events are firing, right click to bring up
std context menu, left click to close, mouseover div again and events
fire.

Here is how I'm setting the innerHTML of the div (I know it could be
cleaner, I'm just testing something).

oContextMenu.innerHTML ='<table width="100" border="0" cellpadding="0"
cellspacing="1" bgcolor="#000000"><tr ><td bgcolor="#cdaf95"
onMouseOut="this.style.background=\'#F7F7F7\';hide Menu();"
onClick="setValue();hideMenu();" onMouseOver="this.style.background
=\'#E8E8E8\';this.style.cursor = \'hand\';">blah</td></tr></table>';

Any help would be appreciated.

teb
Jul 23 '05 #1
1 5014
Try using _return true_...

Just a thought

Ranbir
In article <67**************************@posting.google.com >, Teb wrote:

Here is basically the situation. I have an empty div on my page.
When I mouseover a word, the innerHTML of the div gets written with a
table. The td elements all have onclick, onmouseover, etc. events.
When I mouseover a word, the div appears, but none of the events fire
until another event occurs. For example, if I put in an alert box or
I right click, and then mouseover the div, the td events then work.
Keep in mind that the div is basically acting as a menu. So the
sequence of events that I'm seeing are as follows: mouse over a word,
div appears but none of the events are firing, right click to bring up
std context menu, left click to close, mouseover div again and events
fire.

Here is how I'm setting the innerHTML of the div (I know it could be
cleaner, I'm just testing something).

oContextMenu.innerHTML ='<table width="100" border="0" cellpadding="0"
cellspacing="1" bgcolor="#000000"><tr ><td bgcolor="#cdaf95"
onMouseOut="this.style.background=\'#F7F7F7\';hide Menu();"
onClick="setValue();hideMenu();" onMouseOver="this.style.background
=\'#E8E8E8\';this.style.cursor = \'hand\';">blah</td></tr></table>';



Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: nick | last post by:
Hi All. I have a document loaded into browser. Later, I am loading some HTML content (using hidden frame) and replace some part of my document with new content, using innerHTML property. The...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
3
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace...
2
by: PlainDave | last post by:
Hi all, I'm new to javascript, so please be gentle. :-) I have a "tooltip" script that I found somewhere, and I want to add html tags, links, etc. to the tooltip window. I already use a couple...
4
by: tcole6 | last post by:
My problem appears to be Firefox specific. I have a hyperlink that loads a new window. This window contains hyperlinks that call javascript functions in the parent window and then closes the...
1
by: huzheng001 | last post by:
I have develop a on-line dictionary website, http://www.stardict.org I meet a problem: Here is two lines of js codes: document.getElementById("wordlist").innerHTML = "";...
28
by: ensemble | last post by:
I'm trying to utilized a more object-oriented approach to managing window events in javascript. Thus, I am creating a "controller" object to handle events and interact with the server. However, I...
2
by: Safalra | last post by:
Recently I've rewritten much of my old Javascript code to use DOM functions so that enhancements can be attached to documents without needing to alter the HTML code. I assumed that adding event...
4
by: Joergen Bech | last post by:
I sometimes use delegates for broadcasting "StateChanged" events, i.e. if I have multiple forms and/or controls that need updating at the same time as the result of a change in a global/common...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.