Answers for "jquery call api"

3

how to set json type jquery ajax

$.ajax({
    type: "POST",
    contentType: "application/json",
    url: 'http://localhost:16329/Hello',
    data: { name: 'norm' },
    dataType: "json"
});
Posted by: Guest on June-30-2020
7

jquery ajax get

$.ajax({
    	url: "www.site.com/page",
    	success: function(data){ 
    	    $('#data').text(data);
    	},
    	error: function(){
    		alert("There was an error.");
    	}
    });
Posted by: Guest on March-28-2020
1

jquery ajax endpoint

$.ajax({
  type:"GET/POST",
  url: "target url",
  data: "var1=" + data1,
  success: function(msg){
    $("#targethtml").html(msg)
  },
  error: function(errormsg){
    console.log(errormsg)
  }
});
Posted by: Guest on May-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language