Hello. I'm wondering how to add custom JavaScript code to my forum? I'm using phpBB2.
Thanks!
Thanks!
Last edited by iamataloss on December 7th 2011, 6:41 am; edited 1 time in total
This is a Hitskin.com skin preview
Install the skin • Return to the skin page
$('body').css("display","none");
$(function(){
$("body").css("display","none");});
$(function(){
code here
});
Exactly, I was trying to think of something that would be a very noticeable test and that was the first thing that came to mind.LGforum wrote:As they explained that code was just as a test.
I thought for sure I had tried that already, I was wrong. Works perfectly, thanks everyone!LGforum wrote:The reason it didn't work is because the script go in to the header of the page. That script would have been executed before the body tag had even loaded. For such scripts which require the DOM to be loaded, you need to contain it within the a jQuery DOM ready function, which means the script will wait until the DOM is fully loaded before executing.
As someone mentioned above that would be this:
- Code:
$(function(){
code here
});
Topic Solved & Locked |