javascript onclick function not working
<p>So I adapted this code from another function that does work and is used on the same page. I don't know if that could do anything to it, so I thought I'd mention that, and also that both have id="replace" in them, which I don't know if it could interfere.</p>

<p>Anyway, the code to call the function is this:</p>

<pre><code> if (mysql_num_rows($LIKE) != 0)

{

  echo "
        &lt;td id=\"replace\" style=\"text-align:left\"&gt;".$like." Likes -- &lt;a style=\"color:#234904\" onmouseover=\"this.style.color='#6666CC'\" onmouseout=\"this.style.color='#234904'\" id=\"" . $POST-&gt;id . "\" onclick=\"likePost(this.id)\" name=\"like\"&gt;Like This Post&lt;/td&gt;
        ";
}
</code></pre>

<p>the javascript function is defined as this:</p>

<pre><code>var xmlHttp;

function likePost(x)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }

var pid = document.getElementById(x).id;
var url="forum-like.php";
url+="?pid="+pid;
url+="&amp;sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
</code></pre>

<p>when I click on what should call the function, nothing happens. If I execute the script using the php page called in the js function, that works fine though... I don't know if I missed anything or anything is wrong though... I also know that the $POST->id part does call the right id... hope this is enough info, otherwise let me know and I'll edit in more :D Thanks for any help!</p>
