我需要在 sencha touch2 的面板中添加以下内容
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Check out for more......" data-size="large" data-dnt="true">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
但它只是渲染
<div class="x-innerhtml " id="ext-element-156"><a href="https://twitter.com/share" class="twitter-share-button" data-text="Check out for more @z" data-size="large" data-dnt="true">Tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="http://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div>
代替
<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.1352365724.html#_=1353049473087&count=horizontal&dnt=true&id=twitter-widget-0&lang=en&original_referer=http%3A%2F%2Flocalhost%2Fmyapp%2Fchannel.html&size=l&text=Check%20out%20for%20more......&url=http%3A%2F%2Flocalhost%2Fmyapp%2Fchannel.html" class="twitter-share-button twitter-count-horizontal" style="width: 136px; height: 28px; " title="Twitter Tweet Button" data-twttr-rendered="true"></iframe>
<script id="twitter-wjs" src="//platform.twitter.com/widgets.js"></script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
我在 sencha 中使用以下代码
var tweetbtn = {
xtype: 'panel',
name: 'tweetbtn',
id:"tweetbtn",
width:100,height:100,
html:'<a href="https://twitter.com/share" class="twitter-share-button" data-text="Check out for more......" data-size="large" data-dnt="true">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="http://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>',
} ;
我错过了什么?