0

我有一个网页,我想在其上显示特定用户名的最后一条推文,例如my_username,仅使用 javascript(无服务器端编程)。我抬头一看,发现这样做的简单方法是:

<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> 
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/my_username.json?callback=twitterCallback2&;count=1"></script>

但现在看来,这种方法已被弃用,不再起作用。运行脚本时出现以下错误:

Blocked a frame with origin "https://platform.twitter.com" from accessing a frame with origin "null".  The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "file". Protocols must match.

是否有任何方法可以仅在客户端执行此操作。这甚至可以在不使用 PHP/OAuth 的情况下完成吗?任何帮助将不胜感激。谢谢 !

4

0 回答 0