[Solved] Bypassing cross origin policy using JQuery/javascript with no access to remote server


If you don’t wanna install PHP to do this, why did you tag with php? You need to use a Server Side Script like Proxy PHP file, that reads the content and executes it correctly.

Proxy.php:

<?php
    header("Content-type: application/json");
    die(file_get_contents($_GET["url"]));
?>

And call it like this:

url: "proxy.php?url=http://gov.uk/blah/blah"

solved Bypassing cross origin policy using JQuery/javascript with no access to remote server