Note that there are some explanatory texts on larger screens.

plurals
  1. POIncluding both Tweet Button and Profile Widget on the same page
    primarykey
    data
    text
    <p>I have a situation where I need to include a Twitter profile widget and a Tweet button on the same page. Take the following testing example:</p> <pre><code>&lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="jb-twitter"&gt; &lt;script src="http://widgets.twimg.com/j/2/widget.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; new TWTR.Widget({ version: 2, type: 'profile', rpp: 4, interval: 4000, width: 285, height: 260, theme: { shell: { background: '#ccc', color: '#333333' }, tweets: { background: '#ffffff', color: '#3d3d3d', links: '#0066CC' } }, features: { scrollbar: true, loop: true, live: true, hashtags: true, timestamp: true, avatars: false, behavior: 'default' } }).render().setUser('westlywright').start(); //Twitter JS Func for sharing window.twttr = (function (d, s, id) { var t, js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); return window.twttr || (t = { _e: [], ready: function (f) { t._e.push(f) } }); }(document, "script", "twitter-wjs")); twttr.ready(function (twttr) { twttr.events.bind('click', function () { //some jquery here }); }); &lt;/script&gt; &lt;a href="https://twitter.com/share" class="twitter-share-button" data-lang="en"&gt;Tweet&lt;/a&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>I am getting the following error I am guessing because the two widget.js files are conflicting:</p> <pre><code>Uncaught TypeError: Object # has no method 'ready' </code></pre> <p>Does anyone know how to resolve this?</p> <p>EDIT: Part of the intent of this is to use the Twitter button callback functionality (twttr.events.bind) so that I can track clicks of the button. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload