我正在尝试使用标准代码将小部件嵌入到我的phonegap/cordova应用程序中:
<a class="twitter-timeline" href="https://twitter.com/Elevraadet_OG" data-widget-id="xxxxxxxxxxxxxxxxxx" data-chrome="noheader nofooter transparent noscrollbar" data-tweet-limit="16">Tweets af @Elevraadet_OG</a>
<script>
!function(d,s,id){
var js,
fjs=d.getElementsByTagName(s)[0],
p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id))
{
js=d.createElement(s);
js.id=id;
js.src=p+"://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
}
}(document,"script","twitter-wjs");
</script>
这只是创建推文 af @Elevraadet_OG 链接而不是小部件,为什么这不起作用?
最佳答案
到目前为止,我发现 cordova + twitter feed 存在域问题。这里正在进行长时间的讨论Embedded Timelines in a PhoneGap application
该链接中建议的解决方案很少。你可以尝试一下。还有一种方法可以使用此插件 Twitter Timeline in PhoneGap application 来使用 inAppBrowser
关于cordova - 我试图在 Cordova 中嵌入带有标准代码的 Twitter 小部件,但不知何故它只创建链接而不是小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24467028/