我需要使用 Behance API 对 Behance Design 作品集进行 ajax 分页。
我发现为了使用 API 密钥显示设计 Behance 组合中的所有项目,我需要在 JSON url 末尾更改查询获取分页。
https://api.behance.net/v2/users/rolfo85/projects?client_id=APIKEY&per_page=25 &page=2
所以关键是:我怎么知道什么时候结束,什么时候不再需要分页?
显然页数不可用,项目总数也不可用,我只能选择“page=1, page=2, page=3”等……但不知道哪一个会是最后一个。当然,如果我尝试调用一个不存在的页面,我会收到错误消息。
有什么想法?