hey guys, I want to load a twitter widget javascript on the homepage of my website, and no where else because i get this error in the error info box in IE8
Message: ‘document.getElementById(…)’ is null or not an object
(works fine on the homepage where i have the widget, so the error must be because it's not on the same page as the widget)
i tried adding this to the template file
if (document.getElementById("twitter_div")) {
<scriipt type="text/javascript" src="http://localhost/modules/twitter/blogger.js"></scriipt>
<scriipt type="text/javascript" src="http://twitter.com/statuses/user_timeline/Mytwitter.json?callback=twitterCallback2&count=5"></scriipt>
}
Eseentially, what i want is to to make an if statement saying “if twitter div exists on page, run script, else, don’t”
but it doesn't work. Is there a way to do this with smarty php?