Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Problem trying to retrieve a json object

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44848
    Steven Gardner
    Participant

    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’);
    }
    });

    #135454
    TheDoc
    Member

    Are you getting ‘boo hoo’ to console log?

    #134482
    Steven Gardner
    Participant

    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.

    #135684
    Steven Gardner
    Participant

    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 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.