473,386 Members | 1,721 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,386 software developers and data experts.

Weird things with .innerHTML

Ok, so I'm having some really weird problems. I will try to abstractly explain the problem, as the amount of code involved will be silly to paste in here.

So, I have a <script> tag that pulls in a toolTip js file. That works just fine with static text on my page. But, I have a table that refreshes out of a database, so every so many seconds, I completely rebuild the table using [code].appendChild[.CODE].

For whatever reason, the js calls for the toolTips no longer shows up inside the table. Here's the code for that section:
Expand|Select|Wrap|Line Numbers
  1. tooltipShow(tooltipId, parentId, posX, posY){}
  2. tbl = document.getElementById("resultsTable");
  3. row = document.createElement("tr");
  4. cell = document.createElement("td");
  5.  
  6. shortLocation = "<a href='#' id='" + i + "' style='text-decoration:none;' onmouseover=\"tooltipShow('fullPath" + i + "','" + i + "',0,0);\" onmouseout=\"tooltipHide('fullPath" + i + "');\" onclick='return false'>[MainDir]\\" + department + "...\\" + shortMovName + "</a>";
  7.                     var toolTipDiv = "<div id='fullPath" + i + "' class='tip'>" + result.data[i].EncodedVideoLocation + "</div>";
  8.                     cell.innerHTML = shortLocation + toolTipDiv;
  9.  
  10. row.appendChild(cell);
  11. tbl.appendChild(row);
  12.  
The output looks like this (my static, written link that works with the tooltip is the top line, the generated stuff is the bottom line:

Expand|Select|Wrap|Line Numbers
  1. <a href='#' id='0' style='text-decoration:none;' onmouseover="tooltipShow('fullPath0','0',0,0);" onmouseout="tooltipHide('fullPath0');" onclick='return false'>[MainDir]\HBLL\...\VarenaisBa...</a>
  2. <a href='#' id='0' style='text-decoration:none;' onmouseover="tooltipShow('fullPath0','0',0,0);" onmouseout="tooltipHide('fullPath0');" onclick='return false'>[MainDir]\HBLL\...\VarenaisBa...</a>
  3. <div id='fullPath0' class='tip'>C:\BYUgle_encoding\encoded\HBLL\LRC\VarenaisBaltijasGredzens\</div>
  4. <div id='fullPath0' class='tip'>C:\BYUgle_encoding\encoded\HBLL\LRC\VarenaisBaltijasGredzens\</div>
They are exactly identical. Why will the tooltip not work on the code pulled and generated by my js?

EDIT: I just discovered that having "onclick=alert('words');" didn't work, either. Nothing that requires user input works here. Another clencher? I'm using Adobe AIR to write this.
Oct 14 '10 #1
2 1381
RamananKalirajan
608 512MB
Hi Try with this one.

Expand|Select|Wrap|Line Numbers
  1. tooltipShow(tooltipId, parentId, posX, posY){} 
  2. var tbl = document.getElementById("resultsTable"); 
  3. var rowLen = tbl.rows.length;
  4. var row1 = tbl.inertRow(rowLen);
  5. var cell1 = row1.insertCell(0); 
  6.  
  7. shortLocation = "<a href='#' id='" + i + "' style='text-decoration:none;' onmouseover=\"tooltipShow('fullPath" + i + "','" + i + "',0,0);\" onmouseout=\"tooltipHide('fullPath" + i + "');\" onclick='return false'>[MainDir]\\" + department + "...\\" + shortMovName + "</a>"; 
  8.                     var toolTipDiv = "<div id='fullPath" + i + "' class='tip'>" + result.data[i].EncodedVideoLocation + "</div>"; 
  9.                     cell1.innerHTML = shortLocation + toolTipDiv; 
  10. cell1.innerHTML= shortLocation; 
  11. if(window.ActiveXObject)
  12. cell1.innerHTML = cell1.innerHTML; 
Thanks and Regards
Ramanan Kalirajan
Oct 18 '10 #2
Thanks Ramanan, but that didn't work either. I'm not sure exactly what is going on, here. I'm going to check the scope of my functions and see that's the problem.
Oct 18 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Gidi | last post by:
Hi, i have a dataGrid, and i allocated a keyevents for one of the cells (i did some manipulation on this cell), and i have a strange problem: all the keyevents work except the one i really need...
12
by: sparks | last post by:
My boss and I both have access 97 and access 2003 installed on our systems. Lately he has been having a lot of problems. Databases that won't close. The database looks like it closes but access...
3
by: Henry Jones | last post by:
I am Using Vista with Visual Studio 2005 and when I open a project, it could take a full minute or two before the "start debugging" button turns green on the menu. Also, in the Solution Explorer,...
9
by: -Lost | last post by:
In Firefox and Safari for example, if I serve my XHTML documents as application/xml or xhtml+xml they only display the top inch or so of the document. In Opera it says "object has been blocked."...
12
by: -Lost | last post by:
In Firefox and Safari for example, if I serve my XHTML documents as application/xml or xhtml+xml they only display the top inch or so of the document. In Opera it says "object has been blocked."...
3
by: Liam Gibbs | last post by:
Hello everyone, I'm having trouble figuring out a problem with a page I'm looking at: http://www.international.gc.ca/fac/polar-polaire/final4.aspx?lang=en. Quite obviously, my problem is that...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.