MyBB Community Forums

Full Version: Adding .js File to Header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, this is probably an easy one....

I am trying to add the following above the </head> tag on my forum:

<script type="text/javascript" src="http://www.MYSITE.co.uk/js/jquery-latest.min.js"></script>

So I add it to:

Templates > My Template Name > Index Page Templates > Index

It works fine but only loads on the forum index page, as soon as you click on a sub forum or thread it does not appear in the header.

How can I make it load forum wide?

Thanks in Advance Smile
Try putting it in the Header templates.

E.g.

Templates and Style -> Your theme -> Header -> header
But the code needs to be above the </head> tag, won't that put it below it?
Please use the template "headerinclude".
Great stuff thank you for the quick reply, worked perfect Smile
It would've also worked in the header tag, trust me. I'm using a jQuery script in there at the moment. Smile
(2010-06-07, 01:44 PM)trilobyte- Wrote: [ -> ]It would've also worked in the header tag, trust me. I'm using a jQuery script in there at the moment. Smile
Just to add to this. You header is on every page (I presume), if you had of placed it in there I can guarantee it would of worked Smile
OK now this has caused another problem, when I add the above code it stops the text editor tool bar from loading, when I remove the code again everything is fine.

Can this be fixed?
(2010-06-07, 09:19 PM)Chrissy Poo Wrote: [ -> ]OK now this has caused another problem, when I add the above code it stops the text editor tool bar from loading, when I remove the code again everything is fine.

Can this be fixed?

OK fixed by adding this under it:

<script type="text/javascript">
  $.noConflict();
  // Code that uses other library's $ can follow here.
</script>

I hope this won't cause any other problems?