Hello,
I have this part of php code...
<?php
$dom = new DomDocument();
$dom->load("anna.xml");
$xp = new domxpath($dom);
$unitid = $xp->query("/ead/archdesc/dsc/c01/did/unitid");
foreach ($unitid as $check)
{
print '<a href="#" onClick="displayResult2(' . $check->textContent . ')">' . $check->textContent . ' </a>'; // I presented the unitid's of a xml file and made them clickable.
print "<br/>";
}
?>
and
function displayResult2(id)
{
alert(id);
}
when I click an unitid, The alert message doesn't work :(
what's wrong? (i'm newbie to javascript/php/....)