Jump to content

load a javascript ONLY on the homepage


Recommended Posts

Hello to all. First post here and in need of help.

I want to load the twitter widget javascript only on the homepage because it sends errors on all other webpages (works fine on the homepage where i have the widget, so the error must be because it can't use the widget)

i tried adding this

if (document.getElementById("twitter_div")) {


}



i want to make the if statement say "if twitter div exists on page, run script, else, don't" in the header.tpl

how can i do this using smarty code? please help me guys.

Link to comment
Share on other sites

×
×
  • Create New...