0

I really need help on reading the JSON data on this URL:

http://www.cloudspokes.com/members/ferbie12/past_challenges.json

I am trying to use --disable-web-security on google chrome to solve cross domain issues. here is a code that I wrote to read a simple value on the JSON.

$.getJSON("www.cloudspokes.com/members/ferbie12/past_challenges.json",function(data) {
    $.each(data, function(){
        var test = data.attributes.type;
        $('p#success').append(test);
    });
});

it won't show anything on the browser. really appreciate the help.

update: I also tried using these codes. still no results.

$.ajax({
    type: "POST",
    url: "www.cloudspokes.com/members/ferbie12/past_challenges.json",
    contentType: "application/json; charset=utf-8",
    dataType: "json",

    success: function(data) {
        $.each(data, function(){
            var test = data.attributes.type;
            $('p#success').append(test);
        });
    itemAddCallback(data);
    },
    error: function (xhr, textStatus, errorThrown) {
    $("#success").html(xhr.responseText);   
    }
});

1 Answer 1

2

You are missing the protocol-part of the URI

After fixing it use the following to iterate over the items:

$.each(data, function(index,item){
    var test = item.attributes.type;
    $('p#success').append(test);
});
Sign up to request clarification or add additional context in comments.

1 Comment

hi thanks for answering... found a way around it... it seems that the cross domain issue is still not fixed with the "--disable-web-security"... also your answer helped me... thanks :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.