Hello everyone,
I am stucked in one issue. I have to click on a button and at the background my javascript first go to other page like test.html and in that html page there is a table and my script shouldnt get all the table rows but instead one or two row.
here is my script to help u knowing the logic:
<html>
<head>
<script>
function ShowTT(current,e, value, field_value)
{
var text = "";
if(field_value)
text = document.all[value].value;
else
text = value;
var offsetx = 10;
var offsety = 0;
text = '<table cellpadding="3"><tr><td class="Template34TableTT">' + text;
text += '</td></table>';
if (document.getElementById)
{
var popup_div = document.getElementById('LayerTT');
popup_div.innerHTML=text
popup_div.style.pixelLeft=event.clientX+document.b ody.scrollLeft+offsetx
popup_div.style.pixelTop=event.clientY+document.bo dy.scrollTop+offsety
popup_div.style.visibility="visible"
}
else if (document.all&&document.readyState=="complete")
{
document.all.LayerTT.innerHTML=text
document.all.LayerTT.style.pixelLeft=event.clientX +document.body.scrollLeft+offsetx
document.all.LayerTT.style.pixelTop=event.clientY+ document.body.scrollTop+offsety
document.all.LayerTT.style.visibility="visible"
}
else if (document.layers)
{
document.LayerTT.document.nstip.document.write('<b >'+text+'</b>')
document.LayerTT.document.nstip.document.close()
document.LayerTT.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.LayerTT.left=e.pageX+offsetx
document.LayerTT.top=e.pageY+offsety
document.LayerTT.visibility="show"
}
}
function HideTT()
{
if (document.getElementById)
{
var popup_div = document.getElementById('LayerTT');
popup_div.style.visibility="hidden"
}
else if (document.all)
document.all.LayerTT.style.visibility="hidden"
else if (document.layers)
{
clearInterval(currentscroll)
document.LayerTT.visibility="hidden"
}
}
function MarkDocument()
{
var url = document.URL;
if(url.lastIndexOf('#')>0)
{
var pk_id = url.substr( (url.lastIndexOf('#')+1) ) ;
if(pk_id>0)
{
var mark_table_row = document.getElementById(pk_id);
if(null!=mark_table_row)
{
mark_table_row.className = 'search_highlight';
}
}
}
}
var table = document.getElementsByTagName('table').item(0);
var rowLen = table.getElementsByTagName('tr').length;
for (i = 1; i < rowLen; i++)
{
// Hier fiets je door alle <tr> elementen heen.
alert(table.getElementsByTagName('tr').item(i).chi ldNodes); // childNodes object van het huidige tr element
}
</script>
</head>
<body style='background-color:#ffffff' onLoad='MarkDocument()'>
<div id="LayerTT" class="LayerTT" style="visibility:hidden">Hidden Tool Tip</div>
<table width='630' border='0'>
<tr>
<td valign='middle'>
</td>
</table><br>
<table width='630' border='0'>
<tr><td>
<div align='left'>
<table border='1' bordercolor='white' cellspacing='0' cellpadding='2'>
<tr>
<th width='200' colspan='3'>ID</th><th>Name</th><th width='80'>Date</th></tr>
<tr id='269' class='dark'>
<td valign='top' colspan='3' ><a name='269'></a><a href='../../attachments/pk2_269/demo_sheet.doc' target="_self" onMouseOver="ShowTT(this,event,'<table cellpadding=3 cellspacing=1 border=0><tr class=\'dark\' ><td valign=\'top\'><b>Owner</b></th><td valign=\'top\'>khatera</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Revision No.</b></th><td valign=\'top\'>-</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>Author</b></th><td valign=\'top\'>Khatera</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Processgroup</b></th><td valign=\'top\'>Planning And Tracking</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>ISO-paragraph</b></th><td valign=\'top\'>-</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Discipline</b></th><td valign=\'top\'>-</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>Remark</b></th><td valign=\'top\'>-</td></tr></table>', false);" onMouseOut="HideTT();">987654</td>
<td valign='top' title='Name'>software</td>
<td valign='top' title='Date'>2005-03-08</td>
</tr>
<tr id='272' class='dark'>
<td class='borderdark'> </td>
<td valign='top' colspan='2' ><a name='272'></a><a href='../../attachments/pk2_272/surveyPackage.jar' target="_self" onMouseOver="ShowTT(this,event,'<table cellpadding=3 cellspacing=1 border=0><tr class=\'dark\' ><td valign=\'top\'><b>Owner</b></th><td valign=\'top\'>Khatera</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Revision No.</b></th><td valign=\'top\'>-</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>Author</b></th><td valign=\'top\'>Khatera</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Processgroup</b></th><td valign=\'top\'>Planning And Tracking</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>ISO-paragraph</b></th><td valign=\'top\'>-</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Discipline</b></th><td valign=\'top\'>-</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>Remark</b></th><td valign=\'top\'>-</td></tr></table>', false);" onMouseOut="HideTT();">987654</td>
<td valign='top' title='Name'>software</td>
<td valign='top' title='Date'>2005-03-08</td>
</tr>
<tr id='274' class='dark'>
<td class='borderdark'> </td>
<td class='borderdark'> </td>
<td valign='top' colspan='1' ><a name='274'></a><a href='../../attachments/pk2_274/nik.html' target="_self" onMouseOver="ShowTT(this,event,'<table cellpadding=3 cellspacing=1 border=0><tr class=\'dark\' ><td valign=\'top\'><b>Owner</b></th><td valign=\'top\'>Vinuta</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Revision No.</b></th><td valign=\'top\'>-</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>Author</b></th><td valign=\'top\'>-</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Processgroup</b></th><td valign=\'top\'>testing hardware</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>ISO-paragraph</b></th><td valign=\'top\'>-</td></tr><tr class=\'light\' ><td valign=\'top\'><b>Discipline</b></th><td valign=\'top\'>-</td></tr><tr class=\'dark\' ><td valign=\'top\'><b>Remark</b></th><td valign=\'top\'>-</td></tr></table>', false);" onMouseOut="HideTT();">test</td>
<td valign='top' title='Name'>hardware</td>
<td valign='top' title='Date'>2005-03-15</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
this the page where my script should search on for example "planning and tracking" this the code valign=\'top\'><b>Processgroup</b></th><td valign=\'top\'>Planning And Tracking</td></tr>< and if found should get the whole TD and show it in another page.
can some one help me plz I know this simple to do it with PHP but the requirement is to do it client side way. If some one provide me with a workable script, I can pay him/her.
regards,
poison~IVY