/    Sign up×
Community /Pin to ProfileBookmark

Loading Twitter Blogger.js last outside of IE

I’m using the witter blogger.js to display a users last tweet in my site.

The problem is it’s causing loading problems in anything except i.e. and practically crashes the rest of my page. I’ve used the defer method in ie but obviously this can’t be used in other browsers.

I want this to load after everything else has loaded so it doesn’t affect anything else if it doesn’t but with the code being external it’s tricky. Can anyone help me out

Here is my code which is right at the end of my page:-

[CODE]

<script type=”text/javascript” src=”http://twitter.com/javascripts/blogger.js” defer=”defer”></script>
<script type=”text/javascript” src=”http://twitter.com/statuses/user_timeline/<?php echo $twittername;?>.json?callback=twitterCallback2&amp;count=1″ defer=”defer”></script>

<script type=”text/javascript”>

$(‘#twitter_update_list a’).not(‘:last’).html(‘Click here’);

</script>

[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@rnd_meMar 01.2011 — DOM adders work like defer, only everywhere:

[CODE]<script>
function addScript(u){ var sc2=document.createElement('script'); sc2.src=u; document.getElementsByTagName('*')[1].appendChild(sc2) }
addScript("http://twitter.com/statuses/user_timeline/<?php echo $twittername;?>.json?callback=twitterCallback2&amp;count=1");
</script>[/CODE]
×

Success!

Help @jimmyoneshot 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 6.18,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...