Closed Thread Icon

Topic awaiting preservation: Suggestion for Javascript code change to Ozone pages to fix occasional error Pages that link to <a href="https://ozoneasylum.com/backlink?for=25257" title="Pages that link to Topic awaiting preservation: Suggestion for Javascript code change to Ozone pages to fix occasional error" rel="nofollow" >Topic awaiting preservation: Suggestion for Javascript code change to Ozone pages to fix occasional error\

 
Author Thread
BillyRayPreachersSon
Bipolar (III) Inmate

From: London
Insane since: Jul 2004

posted posted 03-13-2005 20:03

Hi,

Apologies if this is not the right forum for this... Only I couldn't find one that looked more appropriate

Occasionally, when loading a thread in a forum, clicking anywhere in the window pops up a JavaScript error. This, I believe is caused by the onclick attribute in the body element:

code:
onclick="hideForumMenu();"



Would it be possible to assign this after the body has loaded, or maybe modify the hideForumMenu function (in forum_menu.js) to have the second if statement also test for the presence of "tb":

code:
function hideForumMenu() {
var tb = document.getElementById("forum_menu");
if (tb && bodyHide == 2) {
tb.style.display = 'none';
bodyHide = 0;
}

if(tb) if (tb.style.display == 'block') {
bodyHide++;
}
}



The JavaScript alerts with errors are annoying when you occasionally click in a window before the page has loaded.

Thanks,
Dan

(Edited by BillyRayPreachersSon on 03-13-2005 20:05)

(Edited by BillyRayPreachersSon on 03-13-2005 20:05)

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-13-2005 20:48

nohuh, thanks to my ftp-aware editor,
this took a whooping 30 seconds to implement.

body now reads:

code:
<body onclick="if (hideForumMenu) { hideForumMenu();}">


and hideForumMenu() is now

code:
function hideForumMenu()
{
var tb = document.getElementById("forum_menu");
if (tb && bodyHide == 2)
{
tb.style.display = 'none';
bodyHide = 0;
}
if(tb && tb.style.display == 'block'){
bodyHide++;
}
}



so long,

->Tyberius Prime

BillyRayPreachersSon
Bipolar (III) Inmate

From: London
Insane since: Jul 2004

posted posted 03-13-2005 21:14

Excellent - I'm now happier than a PFY gamer with a PS2 Portable

Thanks!

Dan

« BackwardsOnwards »

Show Forum Drop Down Menu