Jump to content

Adding Jquery Files


wstar

Recommended Posts

I created a new page for the admin section.  Everything is working well but when i add a new js file.  I use the following

$this->context->controller->addJquery('../../../../modules/lgs_teams/js/script.js', 'all');

This does load the file, but when I use any jquery code, it errors.  Looking at the page code, it loads the js file ABOVE the jquery file...

<script type="text/javascript" src="/presta_test_1/modules/lgs_teams/js/script.js">
</script> <script type="text/javascript" src="/presta_test_1/js/jquery/jquery-1.11.0.min.js"></script>

How do I get the js file to load at the bottom of the header instead of the top?

Link to comment
Share on other sites

This is just mind blowing for me.  I have tried making the js call in the header hook, setMedia, and everywhere else I can think of.  It loads the file, but not in the right order. Its always loading my file BEFORE the jquery library.

 

I have also tried adding $this->addJquery(); right above, with no luck.

Edited by wstar (see edit history)
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...