0

I have a beginner question.

I am uesing a few plugins for my site. I included jquery , and jquery ui in my header like this

<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.7.2.min.js"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-ui.min.js"></script>

and i included the main js file what i created for global stuff on the site in the footer.

So i dont really want to include the js in the footer what takes effect only on like: the details page

os is it ok if i include jquery in the header, include the main js in the footer, and include the details js in the details view file?

thank you for the advice

2 Answers 2

1

Make sure your base_url is working.In case its not working please set the base_url in the config file and then use this.

$config['base_url'] = '';
Sign up to request clarification or add additional context in comments.

Comments

1

Make sure your URL helper is loaded.

Make sure you have your base_url set in your config with trailing /.

For your JS - You could keep as is or put all in the footer.
Load Jquery first, then ui, then your own js.

For Jquery - use google cdn and your server as backup.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.