Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > innerHTML javascript events not firing

Reply
Thread Tools

innerHTML javascript events not firing

 
 
teb
Guest
Posts: n/a
 
      09-22-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically adding controls with events (but events are not firing) SevDer ASP .Net 2 11-13-2007 06:33 AM
xhtml, innerHtml, appendChild, and innerHTML. what is the exact proper way to do this with DOM sonic Javascript 5 07-11-2006 08:17 AM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
Events not firing (First time only) in a dynamic user control. Please help. =?Utf-8?B?U2hvdXJpZQ==?= ASP .Net 1 01-21-2004 10:31 PM
Web control toolbar events not firing John ASP .Net 0 08-20-2003 03:03 PM



Advertisments