WordPress.org

Forums

AI Twitter Feeds (Twitter widget & shortcode)
[resolved] Uncaught ReferenceError: twttr is not defined (5 posts)

  1. _rg_
    Member
    Posted 1 year ago #

    Hi, working on WP 3.6 and last updated plugin version 2.0.
    I´m using shortcode this way:

    <?php echo do_shortcode("[AIGetTwitterFeeds ai_username='CayenneRedMedia' ai_numberoftweets='10' ai_tweet_title='']"); ?>

    And chrome console give me this error:

    Uncaught ReferenceError: twttr is not defined

    For what i see, the plugin, or de tw api, insert this into the html:

    <p class="thinkTwitFollow"><a href="https://twitter.com/CayenneRedMedia" class="twitter-follow-button" data-show-count="false" data-dnt="true">Follow @</a></p><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");twttr.widgets.load();</script>

    There is where twttr.widgets.load() is called and there is the error.

    Any ideas on why or how to solve this issue?

    https://wordpress.org/plugins/ai-twitter-feeds/

  2. Stephen Pickett
    Member
    Posted 1 year ago #

    Hello,

    I was alerted to this issue as it appears that August Infotech have borrowed some code from the Twitter plugin that I wrote and maintain. I have resolved the issue in my own code (ThinkTwit v1.5.1 - http://wordpress.org/plugins/thinktwit/) and I believe you can resolve this in the plugin by replacing line 545 with the following:

    $ai_follow_html.="<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>";

    To August Infotech: I am flattered that you would borrow some code that I have written. I would appreciate it if you would reference in your code and on your website anything that you borrow - I do this for free, after all, so recognition is very much appreciated.

    Steve

  3. August Infotech
    Member
    Plugin Author

    Posted 1 year ago #

    Hello rg,

    Thanks for using this plugin.

    As per given Stephen Pickett suggestion you can resolve this in the plugin by replacing line 545 with the following:

    $ai_follow_html.="<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>";

    Thanks & Regards,
    August Infotech

  4. August Infotech
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Stephen Pickett,

    Thank you so much for above issue solution given to us ,support and help to us.

    Thanks & Regards,
    August Infotech

  5. Stephen Pickett
    Member
    Posted 1 year ago #

    Hello,

    No problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic