/    Sign up×
Community /Pin to ProfileBookmark

Twitter widget malfunction in IE 8

I’m using the standard Twitter widget on a client’s website (with some minor style adjustment). It works great in everything except IE 8, where it – sometimes, on some pages (like [url]http://www.seattlecoffeeworks.com/index.php?_a=coffeeClub[/url] ) – causes the page to fail to completely load. The error I get when it happens is “HTML Parsing Error: Unable to modify the parent container element before the child element is closed”.

I read elsewhere this is because javascript is attempting to execute before the page has completely loaded. Commenting out the Twitter widget fixes the problem.

Any suggestions on how to fix it?

  • Bob
  • Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Timestamp: Fri, 12 Feb 2010 02:57:09 UTC

    Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
    Line: 0
    Char: 0
    Code: 0
    URI: [url]http://www.seattlecoffeeworks.com/index.php?_a=coffeeClub[/url]

    to post a comment
    JavaScript

    8 Comments(s)

    Copy linkTweet thisAlerts:
    @A1ien51Feb 12.2010 — Did you send an email/tweet to the people who write it and ask them about the problem?

    Eric
    Copy linkTweet thisAlerts:
    @bunner_bobauthorFeb 12.2010 — Not really sure how to contact Twitter - but I'll try
    Copy linkTweet thisAlerts:
    @bunner_bobauthorFeb 12.2010 — Doesn't seem to be any way to contact Twitter. They have some forums but nobody seems to answer posts.

    Can someone who knows more about Javascript than I suggest some way to fix it?
    Copy linkTweet thisAlerts:
    @FangFeb 12.2010 — It appears to work correctly now.

    Try adding <script [COLOR="Blue"]defer="defer"[/COLOR] src="http://s7.addthis.com/js/250/addthis_widget.js#pub=drinkingman" type="text/javascript"></script>
    Copy linkTweet thisAlerts:
    @bunner_bobauthorFeb 12.2010 — Yes - I figured out how to break off the activating part and relocate it near the end. Assigned the return of "new" to a variable:
    [CODE]<script type="text/javascript">
    var twitterWidget = new TWTR.Widget({
    version: 2,
    type: 'profile',
    rpp: 4,
    interval: 6000,
    width: 154,
    height: 300,
    theme: {
    shell: {
    background: '#200f01',
    color: '#ffd350'
    },
    tweets: {
    background: '#70431f',
    color: '#ffffff',
    links: '#ffd350'
    }
    },
    features: {
    scrollbar: false,
    loop: false,
    live: false,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: 'all'
    }
    });
    </script>
    [/CODE]


    And then just before the end of <body>:
    [CODE]<script type="text/javascript">
    twitterWidget.render().setUser('drinkingman').start();
    </script>
    [/CODE]


    I'll give the "defer" a try too though.

    Thanks!
    Copy linkTweet thisAlerts:
    @elflingJul 23.2010 — Works very well in speeding up page load times and making sure the page works. Great work.

    Another fix for the JS file is

    Changing

    [CODE]Array.forEach[/CODE]

    To

    [CODE]Array.prototype.forEach[/CODE]

    As this is a clear mistake by the twitter developers and helps out those IE8 users struggling
    Copy linkTweet thisAlerts:
    @zahmadJun 12.2012 — I am having the same problem, the suggestion to replace "Array.forEach" To Array.prototype.forEach within the JS file appears to no longer be valid in 2012 as there are no such lines in either case.

    Has anyone found a solution to this issue for IE8?

    Thank you in advance. z
    Copy linkTweet thisAlerts:
    @kattiaSep 13.2012 — Any ideas how to resolve this issue, I added the file in my internal folder and still not showing in ie
    ×

    Success!

    Help @bunner_bob spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...