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);
}
});
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…