jquery - grabbing Reddit data via javascript -


I came to this post, which is a lot that I want to do:

< / P>

I modified JSField which has been read ( NSFW ):

  $ GetJSON ("http: //www.reddit.com / r / pics / .json? Jsonp =?", Function (data) {$ .each (data.data.children, function (i, item) {console.log ($ ('. Score.likes') .html (item);});});  

My goal is to collect the total amount of upturn on a given page. When you run it and see the console, the objects are returning, but not the actual number. I thought that the number of votes will return only by calling HTM on selector but apparently wrong. Any better way to do this?

you console.log (item) to see returned data By using we can see that item.data.score returns a post score.

$ GetJSON ("http://www.reddit.com/r/pics/.json?jsonp=?", Function (data) {$ .each (DataData children, jobs (i, items) {console.log (item. Data); $ ('& lt; div / & gt;', {text: 'post' is a digit of '+ item.data.permalink +' + item is .data.score}). AppendTo ('# images' );});});

You have seen objects without numbers, because you called console.log ($ ('selector')) and it Json no jquery object from return request


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -