Grow your CSS skills. Land your dream job.

Problem trying to retrieve a json object

  • # May 17, 2013 at 11:11 am

    I’m having real trouble getting a successful response from this url.

    I have tried a few other json urls to check my code and they work.

    I’ve even run the json from my url in the [jsonlint](http://jsonlint.com/ “JSONLint”) website and it validates fine.

    Can anyone help me.
    I’ve tried so many variations of things but all with the same response.

    $.getJSON( ‘http://arcgisweb.fife.gov.uk/Fife/Nearest/Street.asp?long=-2.8215&lat=56.1904&format=json&jsoncallback=?’, function(data){
    if (data.stat==’ok’) {
    console.log(data);
    }else{
    console.log(‘boo hoo’);
    }
    });

    # May 17, 2013 at 12:29 pm

    Are you getting ‘boo hoo’ to console log?

    # May 17, 2013 at 3:51 pm

    I was messing around with this… it seems that site is only returning json, not jsonp. – see [this answer](http://stackoverflow.com/questions/2887209/what-are-the-differences-between-json-and-jsonp) to find out why they are different.

    # May 20, 2013 at 4:25 am

    I’m not getting to the ‘boo hoo’ statement. I keep getting an invalid statement error.

    Thanks #Mottie for the link but I’m still no clearer on where I’m going wrong.

    # May 20, 2013 at 6:03 am

    decided to use coldfusion to retrieve my json object. I’m having no trouble that way and I’m pushed for time. Will try and work it out in the evening.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".