1

I've got a html file that has jquery stuff in it:

...
$(document).ready(function()
{                               
    $.ajax(
    {
         url: "http://www.somewhere.com/something.php",
         dataType: "json",
         success : function(data)
         {
             $.each( data, function(i, field)
             {
                 $("body").append(field.id + "<br>");
             });
         }
    });
});
...

When I put this html file on my webserver and run it, it works fine; but when I run it locally, it doesn't get the proper data from the url provided.

That PHP file already has the Access Control Origin thing.

Is there a way to make it get the data when I run it locally? Or does it have to sit on my webserver for it to work?

0 Answers0