have a project I'm working on and I'm trying to pull from a Google API. (It does not have a JSONP option).
Right now, I'm getting a "No 'Access-Control-Allow-Origin'" error. I've added the following php:
<?php
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Content-Range, Content-Disposition, Content-Description');
?>
And here is my Ajax call:
$.getJSON(path,function(data) {
console.log(typeof(data));
});
Any thoughts?