JavaScript Add twitter widget into extjs panel embed twitter widget into website

I am new to ExtJs. I have created a twitter widget on twitter. It just works fine on simple html page. As twitter says you just need to include

<a class="twitter-timeline" target='_blank' href="https://twitter.com/search?q=%23certain" data-widget-id="widget-id">Tweets about "#certain"</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>

Putting this to an html creates a beautiful widget on UI but i want this to include into an extjs panel. It only creates a hyperlink and not widget. Can anyone help me.

Answer:1

If anyone is looking for an answer, here is how I have achieved it,

var tweetHtml = '<a class="twitter-timeline" target='_blank' href="https://twitter.com/search" data-widget-id="your-widget-id" height="' + height + '" >Tweets for Certain Mobile</a>';
var dialog = new Ext.Panel({
    xtype: 'panel',
    height: '100%',
    border: false,
    scroll: 'vertical',
    listeners: {
        single: true, // Remove the listener after first invocation
        afterrender: function() {
            ! 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");
        }
    },
    html: tweetHtml
});
Answer:2

In the config object that you pass to the constructor of the Ext.Panel, just include a line for the html property. The value of the property is just the HTML string that defines your Twitter widget.

Answer:3

How do I parse this to int? "'10'" Thanks.

How do I parse this to int? "'10'" Thanks.

  1. convert double quotes to html
  2. convert double quotes to ascii
  3. convert double quotes javascript
  4. vscode convert double quotes to single
  5. php convert double quotes to single
  6. json convert double quotes
  7. php convert double quotes
  8. python convert double quotes
  9. java convert double quotes
  10. bash convert double quote

I'm using phantomjs for taking screenshots of several webpages. To get a screenshot image i have used the following code. var page = require('webpage').create(); page.viewportSize = { width: 1200,...

I'm using phantomjs for taking screenshots of several webpages. To get a screenshot image i have used the following code. var page = require('webpage').create(); page.viewportSize = { width: 1200,...

I am trying to load webviews in a view pager. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = null; ...

I am trying to load webviews in a view pager. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = null; ...

I have a form that accepts name, phone no. Currently, I have done validation for non empty fields. I want to add validation for name (alphabets) and phone no.(numbers). My current code is given ...

I have a form that accepts name, phone no. Currently, I have done validation for non empty fields. I want to add validation for name (alphabets) and phone no.(numbers). My current code is given ...

  1. javascript check empty number