How To Add jQuery to MyBB Tutorial For Newbies

Adding jQuery to a MyBB board can be really difficult task if you do not know what you are doing.  Even if you are an experienced webmaster it can still be pretty tricky as there a few more steps you have to take in order to make it compatible.

jQuery is a nice Javascript library which was created by jQuery.  It reduces the amount of code needed to make a script therefore making your site slightly faster.  I like jQuery typically because of the web 2.0 feel it can add to your site.

You can either choose to host the jQuery libary yourself or you could have Google or the jQuery website to host it for you.  I recommend you let Google host it for performance issues.

For the tutorial I am going to show you how too add jQuery when it’s hosted by Google.

The Process

  1. Locate the jQuery script you wish to use.  The scripts can be found here on the jQuery website or Google.
  2. Log into your admin cp on your forum.  Click on “templates and style” then click on templates.
  3. Next you want to expand the template group you are currently using with your theme.
  4. Scroll down to the bottom of the list  and expand “Ungrouped Templates”
  5. Find the “headerinclude” file and click on the options button (which is in the same row) and then click “Full Edit”
  6. You should now see the file contents of “headerinclude” open in front of you.
  7. Copy and paste this code:
  8.  <script type="text/javascript" src=""></script>

    This is the Google hosted version of jQuery and is known to give you good performance. You can self host jQuery by downloading it from the jQuery website and uploading it to your server.

  9. The last part invloves you adding the code to the script you have created:
  10. This stops the script colliding with the Javascript Library MyBB currently uses, ProtoType.  You need to add that to the beginning of every jQuery script you create.  This step is really important.  Note: You don’t put it into the actual jQuery library.

So There We Have It

How to Add jQuery to MyBB for Newbies, seems simple enough. You can’t forget to do step 9 or the jQuery script you have will not work.

Why another blog about forums? Great question, we are just a couple of forum owners who have built ours forums from the ground-up. We just wanted a blog for real life forum owners, with real life experiences.

View all contributions by

Get more updates by subscribing

Leave a Comment