| | #1 |
| Active Warrior Join Date: 2011
Posts: 44
Thanks: 3
Thanked 1 Time in 1 Post
|
Hello I am making rating system and i wanna send value using xmlhttp.send(); and i wanna show my final result in alert box please help me this is my code system work like this first user click on this <a href="javascript: void(0)" title="1 star out of 10" class="one-star" onclick="return one()" onfocus="rating_submit(1)">1</a> this is my function <script type="text/javascript"> function rating_submit(str) { if (str=="") { document.getElementById("ajaxuse").innerHTML=""; return; } if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("ajaxuse").innerHTML=xmlht tp.responseText; } } xmlhttp.open("GET","rating.php?films=<?php echo $$films; ?>&film_name=<?php echo $film_name; ?>&film_id=<?php echo $film_id; ?>&username=<?php echo $username; ?>&rating="+str,true); xmlhttp.send(); } </script> |
| | |
| |
| | #2 |
| Active Warrior Join Date: 2011
Posts: 44
Thanks: 3
Thanked 1 Time in 1 Post
|
now i solve half of this problem by myself but one small appearing again if (xmlhttp.readyState==4 && xmlhttp.status==200) { //document.getElementById("ajaxuse").innerHTML=xmlht tp.responseText; var abccc = xmlhttp.responseText; alert(abccc); } alert box is showing many times like 4 to 5 times... how can i remove this error |
| | |
| |
|
| Bookmarks |
| Tags |
| alert, box, data, result, sending, show, xmlhttpsend |
| |