User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 327,512 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,248 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 835 | Replies: 5 | Solved
Reply
Join Date: Mar 2006
Location: India
Posts: 47
Reputation: shaikh_mshariq is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
shaikh_mshariq's Avatar
shaikh_mshariq shaikh_mshariq is offline Offline
Light Poster

Onclick does not work in ie for multiple object

  #1  
Mar 28th, 2008
I have one table which is generated using javascript dynamically.
In have write one function which creates table dynamically
for IE i have writed
mytable.onClick=some_function();
for onclick event it works fine.
But when i generate more than one table dynamically using the same function then onclick does not work. If anyone have solution please reply asap. Thanx for spending your precious time.
Ideas are the building blocks of Ideas

Jason Zebehazy
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 149
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: Onclick does not work in ie for multiple object

  #2  
Mar 28th, 2008
Usually the simplest thing to do is to click on the yellow ! icon in the bottom left of the browser window in IE. This will tell you the error. Better still, use Firefox and use the error console.

We can't see your code, so thats the best I can do.


Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Reply With Quote  
Join Date: Jun 2007
Posts: 17
Reputation: ghostsquad is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
ghostsquad ghostsquad is offline Offline
Newbie Poster

Re: Onclick does not work in ie for multiple object

  #3  
Mar 28th, 2008
I agree. use the error console in firefox. most times, if it works in FF, it'll work in IE.
Reply With Quote  
Join Date: Mar 2006
Location: India
Posts: 47
Reputation: shaikh_mshariq is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
shaikh_mshariq's Avatar
shaikh_mshariq shaikh_mshariq is offline Offline
Light Poster

Re: Onclick does not work in ie for multiple object

  #4  
Mar 30th, 2008
It works Very good in FireFox and Opera but in ie how ever it doesnot work for multiple objects
Ideas are the building blocks of Ideas

Jason Zebehazy
Reply With Quote  
Join Date: Mar 2006
Location: India
Posts: 47
Reputation: shaikh_mshariq is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
shaikh_mshariq's Avatar
shaikh_mshariq shaikh_mshariq is offline Offline
Light Poster

Re: Onclick does not work in ie for multiple object

  #5  
Mar 30th, 2008
I have writed My code below for better understanding.This code works fine for one object but for more than one object it does not work or no error is occur.


  1. function getNodeTable(ip){
  2. //alert("IE getNode Table");
  3. var nodeTable=document.createElement("TABLE");
  4. nodeTable.align='center';
  5. var nodebody=document.createElement("TBODY");
  6. var tableRow,tableCell;
  7. nodebody.id='body'+ip;
  8. nodeTable.appendChild(nodebody);
  9. nodeTable.border=0;
  10. nodeTable.id=ip;
  11. nodeTable.name=ip;
  12. tableRow=document.createElement("TR");
  13. tableCell=document.createElement("TD");
  14. tableCell.align='center';
  15. tableCell.innerHTML='<img src=../images/waiting.gif height=62 width=88>';
  16. tableRow.appendChild(tableCell);
  17. nodebody.appendChild(tableRow);
  18. tableRow=document.createElement("TR");
  19. tableCell=document.createElement("TD");
  20. tableCell.innerHTML='<div color=white align=center>Gathering Information <img src=../images/ajax-loader.gif></div>';//replace with actual message
  21. tableRow.appendChild(tableCell);
  22. nodebody.appendChild(tableRow);
  23. var ipbkup="'"+ip+"'";
  24. nodeTable.setAttribute('onClick','sendToServe('+ipbkup+')');//generic method in ajaxcode.js
  25. nodeTable.onMouseOver="javascript:this.style.cursor='pointer'";
  26. nodeTable.onLoad=sendRequestToServer(nodeTable,ip);
  27. var newCell=document.createElement("DIV");
  28. newCell.appendChild(nodeTable);
  29. return newCell;
  30. }
Last edited by peter_budo : Apr 1st, 2008 at 7:13 am. Reason: Keep It Organized - please use [code] tags
Ideas are the building blocks of Ideas

Jason Zebehazy
Reply With Quote  
Join Date: Mar 2006
Location: India
Posts: 47
Reputation: shaikh_mshariq is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
shaikh_mshariq's Avatar
shaikh_mshariq shaikh_mshariq is offline Offline
Light Poster

Re: Onclick does not work in ie for multiple object

  #6  
Mar 31st, 2008
I have found the bug. Thanx for your help. My function gives me table in a div and i forgot to remove div while appending it to the document. I have writed code for only one object and it was not there for multiple object so that was the problem. Thanx for spending your valuable time friends.
Ideas are the building blocks of Ideas

Jason Zebehazy
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Marketplace (Sponsored Links)
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:59 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC