How to fix “CORS problem: No ‘Access-Control-Allow-Origin’ Header is present on the requested resource.” [duplicate]

Ask A Question

Login To post a question

I have been trying to request data from google using the distance matrix but everytime I requested it throws up “Cross-Origin Request Blocked” using AJAX API.

Whenever I make use of PostMan it returns properly.

     type: "GET",
     url: "",
     dataType: "json",
     crossDomain: true,
     cache: false,
     success: function(data){

This is the error returned:

Access to XMLHttpRequest at ‘‘ from origin ‘‘ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

For more info please click here

Have a question or need a custom quote?