ajax code-
...
xmlhttp.open("GET","voting.php?qid="+qid+", uid="+uid+", type="+type,true);
...
is this the correct way to sent three parameters??
html-
<td ><img src="images/up.jpeg" style="border:none;" title="Like" onclick="doVote($q_id,$_SESSION['UserId'],up)"></td>
when I am clicking on this image ajax script is not working.where should I fire onclick function???
Three mistakes:
The correct notation for multiple GET parameters is separating them by
&or, if used in HTML source, the correct HTML entity&To output a PHP variable, you need to wrap them around PHP tags:
The third parameter to
doVote(), “up”, needs to be enclosed in quotes if it’s meant to be a string:other than that, the onclick event should fire. Check your error console for any errors.