Jump to content

Javascript Doesn't Load On Front Page


Recommended Posts

Hello,

 

I had made a countdown teller in a widget and hooked it to the header.

But now the problem is that the JS load on all page except for the front page.

 

I made the template on one domain and host and then i moved it to another domain and host and now it doesn't show up in the front page. So everything was working before. But after i moved it it's not working on the homepage.

 

I tried to put the widget in another hook, and no matter witch hook i put it in it doesn't show up on the front page. But all other pages is it working fine.

 

 

post-758322-0-13569800-1450527965_thumb.png

post-758322-0-74098700-1450527968_thumb.png

Link to comment
Share on other sites

Hi, probably if you look at where hook called in .tpl, there is a check for page=index and if so not executed.  I see that 'a lot'..lol

 

To avoid add hook to module: register name header  hook function name:hookHeader

 

here you  will want to call your .js file

$this->context->controller->addJS(($this->_path).'your_js_name.js');
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...