Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 5th Sep 2012, 12:07 PM   #1
Active Warrior
 
Join Date: 2011
Posts: 44
Thanks: 3
Thanked 1 Time in 1 Post
Default
show result in alert box after sending data using xmlhttp.send()
Share on: 
fb share twitter share gplus share more share

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>

lovefax89 is offline  
Unread 5th Sep 2012, 12:36 PM   #2
Active Warrior
 
Join Date: 2011
Posts: 44
Thanks: 3
Thanked 1 Time in 1 Post
Default
Re: show result in alert box after sending data using xmlhttp.send()
Share on: 
fb share twitter share gplus share more share

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

lovefax89 is offline  
Closed Thread


Bookmarks

Tags
alert, box, data, result, sending, show, xmlhttpsend


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 12:21 PM.