MyBB Community Forums

Full Version: How to incude a javascript to showthread.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi i like to use bumbbox.js with my forum.

i need to include two javescript file to showthread.php.

the main reason is to display pdf file in the shadowbox when user clicks on the link

i tried manually adding those to the php file but that doesnt work..

any ideas?

thanks a lot in advance
Open up the header template in your ACP and add the following code wherever in that template. The header template is shown on all pages. You can add this code to the showthread template or wherever - basically where you want it to be included.

<script type="text/javascript" src="bumbbox.js"></script>

Note that if you have the script file in a different directory than the one showthread.php is in, you will have to reference it.
i tried that too.. but it was not working.. my link open my pdfs straight away instead of opening thru bumbox
I'm not experienced with opening pdf files through web browsers. I can only tell you how to use js files in your MyBB forum.

If the only way to open pdf files is to attach a js file to your page then do the steps I provided. It may be helpful to post the coding of the js file to understand what you want to do.