开发者

Simple getJson causing me major headaches

I'm trying to grab some data from facebook, and since it is a pretty huge amount of requests I've created a php file that will output to a nice .html file once a day. the data comes back from facebook as json so I'm doing my best to maintain that, but I'm having trouble getting any values back after retrieving the valid JSON.

simplified code looks like this:

    var graphURL = "http://www.explorevictoria.dreamhosters.com/csv/graphdata.html";

    jQuery.getJSON(graphURL, function(data){
       $.each(data.item, function(){
           aler开发者_Go百科t(this.id); 
        }) 

    });

I keep getting a mix of undefined, null, or broken javascript. So I turn to you oh stack overflow gurus. Is there a fundamental flaw in my procedure?


Short answer, your json is invalid. http://www.explorevictoria.dreamhosters.com/csv/graphdata.html just scroll down and you'll see text which is clearly just some loose html. "item": <HTML><HEAD> <TITLE>400 Bad Request</TITLE> </HEAD><BODY> <H1>Method Not Implemented</H1> Invalid method in request<P> </BODY></HTML> , "item":<HTML><HEAD> <TITLE>400 Bad Request</TITLE> </HEAD><BODY> <H1>Method Not Implemented</H1> Invalid method in request<P> </BODY></HTML>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜