jQuery Ajax returns the whole page

Posted by Sophia Gavish on Stack Overflow See other posts from Stack Overflow or by Sophia Gavish
Published on 2010-04-06T15:48:50Z Indexed on 2010/04/06 15:53 UTC
Read the original article Hit count: 336

Filed under:
|
|

Dear all, I have a jquery-ajax function that sends data to a php script and the problem is with the return value, it returns the whole page instead of single value.

Thank you for your time and help.

$("#ajaxBtn").click(function(){
var inputText = $("#testText").val();

$.ajax({ type: "POST",
url: "index.php",
data: "testAjax="+inputText,
dataType: "html",
success: function(html){
alert(html);
}
 });
});         

© Stack Overflow or respective owner

Related posts about jquery-ajax

Related posts about php