Max Harbarth Max Harbarth - 1 year ago 127
Javascript Question

Empty console after console.log() call in Javascript

So, my code is

$.getJSON(",92.773715", function(data){

but console is empty. No errors, just nothing. what am I doing wrong?

Answer Source

Won't work the way that you're expecting it to (unless you're running that javascript from a frontend view that is hosted at

You are running into the classic Cross Domain resource issue.

Looks like they don't have Access-Control-Allow-Origin: *

You'll probably need to curl the request on your web server (server-side) and issue your javascript request to your own web server.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download