HI,
   I got a very different situation when writing program for ajax.
Actually I need to get 55 rows from a table displayed in row
format......now when i click the link (any of these 55 links) i need
to get details immediately after the link for this i used ajax....the
problem i am dynamically the links below each row i assigned <div> tag
with id as row. But when coming to javascript i tired to send div tag
id along with the php program that is generating xml file. I am
reading id in to a variable and using document.getElementById("HERE
the variable") but instead of taking the value in variable the
document.getElementById is treating variable itself as an id. I didnot
understand what to do now.

Example:
INDEX PAGE:


$que=" SELECT * FROM heroslisttable ORDER by heroname";
$x=mysql_query($que);
while($out=mysql_fetch_row($x)){
echo "<div id='$out[0]'>";
$cd=strtoupper($out[0]);
?>
<a href='javascript:herodetails("<? echo $out[0]; ?>")'><span
class='topics_head'><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?
echo $cd; ?></b></span></a>&nbsp;&nbsp;

</div>
<?
}
?>

Javascript:
var myDiv=secondtdArray.item(0).firstChild.data;
firsttdArray=xmlRoot.getElementsByTagName("second");
document.getElementById("myDiv").innerHTML =firsttdArray.item
(0).firstChild.data;

I tired to secondtdArray.item(0).firstChild.data directly in place of
myDiv in document.getElementById...................The error show is

document.getElementById("secondtdArray.item(0).firstChild.data") is
null

When i used a specified address the functionalityis geting fine









Thanks And Regards,
Anjith

Reply via email to