abluka
9/6/2019 - 1:30 PM

Ajax get web page example with result

Ajax get web page example with result.

   
  $.get("ajax.php?task=check&id="+id, function(data, status){
    if (data == "0")
	{
		console.log("BEKLE DURUM 0");
	}});


	Ajax Normal POST GET REQUEST example
	
		sendajax(owner,cardNumber,CVV,tutar,month,year)
	{
	return 	$.ajax({
	            type        : 'POST', // define the type of HTTP verb we want to use (POST for our form)
	            url         : 'ajax.php?task=new', // the url where we want to POST
	            data        : 'owner='+owner.val()+'&cardNumber='+cardNumber.val()+'&CVV='+CVV.val()+'&tutar='+tutar.val()+'&month='+month.val()+'&year='+year.val(), // our data object
	            // dataType    : 'json', // what type of data do we expect back from the server
	            // encode      : true,
				success: function(result){
	      
	    }