jquery ajax CORS

163

jquery ajax CORS -

var settings = {
          'cache': false,
          'dataType': "jsonp",
          "async": true,
          "crossDomain": true,
          "url": "https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=place_id:"+me.originPlaceId+"&destinations=place_id:"+me.destinationPlaceId+"®ion=ng&units=metric&key=mykey",
          "method": "GET",
          "headers": {
              "accept": "application/json",
              "Access-Control-Allow-Origin":"*"
          }
      }

      $.ajax(settings).done(function (response) {
          console.log(response);

      });

jquery ajax CORS -

$.ajax({url: "http://localhost:8079/students/add/",type: "POST",crossDomain: true,data: JSON.stringify(somejson)dataType: "json",success: function (response{var resp = JSON.parse(response)alert(resp.status);},error: function (xhr, status) {alert("error");}});

jquery ajax CORS -

$.ajax({url: "http://localhost:8079/clients/add/",type: "POST",crossDomain: true,data: JSON.stringify(somejson)dataType: "json",success: function (response{var resp = JSON.parse(response)alert(resp.status);},error: function (xhr, status) {alert("error");}});

Comments

Submit
0 Comments