javascript - jribbble 不返回结果

标签 javascript jquery html

我在我的页面上运行 jribbble,以从我的运球页面带回投篮。它已经工作了一段时间了。但是,最近几天在控制台中一直显示此错误:

Failed to load resource: the server responded with a status of 404 (Not Found)

网站:http://atlantadesign.ninja/

JS:

<script type="text/javascript">
$(document).ready(function getDribbbleShots() {   
  $.jribbble.getShotsByPlayerId('abenjamin765', function (playerShots) {
      var html = [];

      $.each(playerShots.shots, function (i, shot) {
          html.push(

            '<li class="tile"><div>'+
                '<a class="thumb" href="'+shot.image_url+'" data-lightbox="project" data-title="'+shot.title+'"><figure>⤢</figure>' +

                  '<img src="'+shot.image_url+'" alt="'+shot.title+'" />' +

                '</a>' +
                '<a class="link" href="'+shot.url+'">'+shot.title+' →</a>'+
            '</div></li>'
            );
      });
      $('.dribbble-feed').html(html.join(''));
      $('.dribbble-feed').append('<li class="tile"><div><a class="link special" href="http://dribbble.com/aBenjamin765" target="_blank">See more on Dribbble →</a></div></li>'); 
  }, {page: 1, per_page: 12});
});
</script>

最佳答案

Dribbble 现在要求您注册应用程序才能获取 API key 。

看看这个例子:http://codepen.io/tylergaw/pen/NqpzvE

// NOTE: Don't use this token, replace it with your own client access token.
$.jribbble.setToken('f688ac519289f19ce5cebc1383c15ad5c02bd58205cd83c86cbb0ce09170c1b4');

$.jribbble.users('tylergaw').shots({per_page: 36}).then(function(shots) {
  var html = [];

  shots.forEach(function(shot) {
    html.push('<li class="shots--shot">');
    html.push('<a href="' + shot.html_url + '" target="_blank">');
    html.push('<img src="' + shot.images.normal + '">');
    html.push('</a></li>');
  });

  $('.shots').html(html.join(''));
});

关于javascript - jribbble 不返回结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33267517/

相关文章:

javascript - JS - 删除段落中的所有图像和格式

javascript - 取消浏览另一个文件时如何保留附件

javascript - 如何使用 JavaScript 将字符添加到字符串的随机空间?

javascript - 使用 Javascript 对象填充菜单,然后使用菜单创建 DOM 元素

html - 网站无法在移动设备上正确调整大小

html - 在占据全屏的 parent 中垂直居中 child

javascript - 如何使用angularjs在 float 条形图点击事件上显示数据列表

javascript - Node 配置中的多个 RabbitMQ 或其他后端服务器

jquery - 定位 jQuery UI 小部件

javascript - jquery:如何在单击-按住-释放操作后触发事件?