external url reference error, local works

Problems with the Windows version of XAMPP, questions, comments, and anything related.

external url reference error, local works

Postby ggalan » 22. September 2011 16:06

when i have a json file local, everything works fine.
when i call it in from an external url there is an error, any ideas why and how to fix it?
Code: Select all
$(document).ready(function(){
//var url='data.json';// << works fine
var url='http://www.myurl.com/data.json';//does not parse from localhost, but works on my godaddy server
  $.getJSON(url, function(data){
    $.each(data.data, function(i, entry) {
       $("p:last").append(entry.img + '<br/>');
    });
  });
});
ggalan
 
Posts: 9
Joined: 02. September 2011 19:51

Re: external url reference error, local works

Postby ggalan » 24. September 2011 16:10

anyone?
ggalan
 
Posts: 9
Joined: 02. September 2011 19:51

Re: external url reference error, local works

Postby JonB » 24. September 2011 19:34

IF you are getting that data from your GoDaddy server - you might not be able to request it from a remote server - look for a .htaccess thingy - or a different call needed)
(I'm not a Jquery expert)

reason - you don't want other server's acting on YOUR data.

think about it

read this also -
http://stackoverflow.com/questions/2329 ... rver-fails

Good Luck
:cool:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: external url reference error, local works

Postby ggalan » 24. September 2011 20:24

thanks, i thought it was a setting in the server.
ggalan
 
Posts: 9
Joined: 02. September 2011 19:51


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 127 guests