php - Bypassing cross origin policy using JQuery/javascript with no access to remote server -
i want retrieve following json using javascript:
https://www.gov.uk/api/organisations/skills-funding-agency
if jsonp call get:
callback=jquery1113043552865949459374_1434727982051&_=1434727982052' because mime type ('application/json') not executable, , strict mime type checking enabled.
if json call get:
xmlhttprequest cannot load no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access.
is @ possible? i've been googling hours without success. i've seen php solutions ideally don't want have install php this.
thanks in advance!
if don't wanna install php this, why did tag php? need use server side script proxy php file, reads content , executes correctly.
proxy.php
:
<?php header("content-type: application/json"); die(file_get_contents($_get["url"])); ?>
and call this:
url: "proxy.php?url=http://gov.uk/blah/blah"
Comments
Post a Comment