How to display a link to my latest Tumblr post using Javascript?

后端 未结 1 827
眼角桃花
眼角桃花 2020-12-21 19:41

I am looking for some help and would be VERY grateful for it. I would like to use Javascript to display a link to my latest Tumblr post. For example, it would be like:

相关标签:
1条回答
  • 2020-12-21 20:22

    i think this will get you what you need:

    $.getJSON('http://brianjsmith.tumblr.com/api/read/json?callback=?',
    function(response) {
       $('#myLink').attr('href',response.posts[0].url);
    });
    

    edit: ok, forget what i had before. doesn't work for tumblr apparently. this does though.

    0 讨论(0)
提交回复
热议问题