Quantcast
Viewing all articles
Browse latest Browse all 210

jQuery Ajax returns the whole page

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.

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

Viewing all articles
Browse latest Browse all 210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>