Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Tue, 10 Jun 2008 14:11:10 -0700,    group: microsoft.public.inetsdk.programming.scripting.jscript        back       


IE8 events not working   
I have some javascript that creates rows and cells in a table.  The cell 
don't have anything in them.  CSS sets a fixed width and heigth and a 
background color.  For IE, I use attachEvent('onclick', click_handler).  This 
works fine in IE up to version 7.  I get no events in IE8.  Below is a code 
sample:

var table=document.getElementById('my_table');
for (var row=0; row<num_rows; row++) {
 var new_row = document.createElement('tr');
 for (var col=0; col<num_cols; co++) {
  var new_col = document.createElement('td');
  new_col.className = 'pixel_off';
  new_col.width = pixel_size;
  new_col.height = pixel_size;
  new_col.attachEvent('onclick', click_handler);
  new_row.appendChild(new_col);
 }
 table.appendChild(new_row);
}
date: Tue, 10 Jun 2008 14:11:10 -0700   author:   Chris P Elliott Chris P

Re: IE8 events not working   
Chris P Elliott <Chris P Elliott@discussions.microsoft.com> wrote:
> I have some javascript that creates rows and cells in a table.  The
> cell don't have anything in them.  CSS sets a fixed width and heigth
> and a background color.  For IE, I use attachEvent('onclick',
> click_handler).  This works fine in IE up to version 7.  I get no
> events in IE8.  Below is a code sample:
>
>  new_col.attachEvent('onclick', click_handler);
>  new_row.appendChild(new_col);

Try putting these two lines the other way round. I don't know about IE8, 
but in FireFox one can't attach event handlers on an element that hasn't 
been inserted into DOM yet.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Tue, 10 Jun 2008 19:48:30 -0400   author:   Igor Tandetnik

RE: IE8 events not working   
I'm also worried about this...  The onclick event is not working.

"Chris P Elliott" wrote:

> I have some javascript that creates rows and cells in a table.  The cell 
> don't have anything in them.  CSS sets a fixed width and heigth and a 
> background color.  For IE, I use attachEvent('onclick', click_handler).  This 
> works fine in IE up to version 7.  I get no events in IE8.  Below is a code 
> sample:
> 
> var table=document.getElementById('my_table');
> for (var row=0; row<num_rows; row++) {
>  var new_row = document.createElement('tr');
>  for (var col=0; col<num_cols; co++) {
>   var new_col = document.createElement('td');
>   new_col.className = 'pixel_off';
>   new_col.width = pixel_size;
>   new_col.height = pixel_size;
>   new_col.attachEvent('onclick', click_handler);
>   new_row.appendChild(new_col);
>  }
>  table.appendChild(new_row);
> }
date: Tue, 10 Jun 2008 22:40:00 -0700   author:   squidjam

RE: IE8 events not working   
I got it down to a single line that causes IE8 to not handle onclick event 
for an empty cell.  If I delete the first line on my page, it works:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/REC-html40/transitional.dtd">

I would rather not delete this line as much testing has been completed with 
other browsers.  Any idea if Microsoft is planning to fix this one before 
release?
date: Wed, 18 Jun 2008 08:18:06 -0700   author:   Chris P Elliott

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us