Ozzu Fader script problem

  • King Moonraiser
  • Born
  • Born
  • User avatar
  • Joined: Jun 13, 2005
  • Posts: 1
  • Status: Offline

Post June 13th, 2005, 7:32 am

If you browse these forums using Opera 8.x, you will notice the link fader doesn't work too well. I believe this is due to Opera fixing their DOM to be more standard in the new release. Just replace the detection logic:

Before:
Code: [ Select ]
if (navigator.userAgent.indexOf("Opera") != -1) opera = true
else if (document.all && !opera) ie = true
else if (!document.all && document.getElementById) dom = true;
  1. if (navigator.userAgent.indexOf("Opera") != -1) opera = true
  2. else if (document.all && !opera) ie = true
  3. else if (!document.all && document.getElementById) dom = true;

After:
Code: [ Select ]
// Modified to let Opera 8 use standard dom
opera = false;
ie = false;
dom = false;

if (navigator.userAgent.indexOf("Opera 8") != -1 || navigator.userAgent.indexOf("Opera/8") != -1) dom = true;
else if (navigator.userAgent.indexOf("Opera") != -1) opera = true;
else if (document.all && !opera) ie = true;
else if (!document.all && document.getElementById) dom = true;
  1. // Modified to let Opera 8 use standard dom
  2. opera = false;
  3. ie = false;
  4. dom = false;
  5. if (navigator.userAgent.indexOf("Opera 8") != -1 || navigator.userAgent.indexOf("Opera/8") != -1) dom = true;
  6. else if (navigator.userAgent.indexOf("Opera") != -1) opera = true;
  7. else if (document.all && !opera) ie = true;
  8. else if (!document.all && document.getElementById) dom = true;

Opera 8.0 seemed to need the variables to be explicitly set (true of false) rather than undefined.

I don't know if the fix applies to the 7.x series of Opera. If so, it could be extended to check for Opera 7.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 13th, 2005, 7:32 am

  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Jul 06, 2004
  • Posts: 1890
  • Loc: Las Vegas
  • Status: Offline

Post July 26th, 2005, 11:05 pm

I think someone needs to take a look at the fader.js script here on Ozzu.

It throws errors almost constantly in Firefox, and rarely, it throws about 10 errors a second, which clogs up the Firefox JS console so bad, it slows the browser to a crawl until I refresh the page or click a link.

The first error is:
Code: [ Select ]
Error: fader is not defined
Source File: http://www.ozzu.com/fader.js
Line: 130
  1. Error: fader is not defined
  2. Source File: http://www.ozzu.com/fader.js
  3. Line: 130


the second error is:
Code: [ Select ]
Error: document.links[x] has no properties
Source File: http://www.ozzu.com/fader.js
Line: 118
  1. Error: document.links[x] has no properties
  2. Source File: http://www.ozzu.com/fader.js
  3. Line: 118


and the one that clogs my JS console is:
Code: [ Select ]
Error: uncaught exception: [Exception... "Object cannot be created in this context" code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)" location: "http://www.ozzu.com/fader.js Line: 58"]


All of this is on Firefox 1.0.6 (but has happened since at least 1.0.4)

Anyone else seeing similar behavior or is it just me?
  • MISC/A++
  • Expert
  • Expert
  • User avatar
  • Joined: Sep 08, 2004
  • Posts: 508
  • Loc: UnderGround
  • Status: Offline

Post July 27th, 2005, 12:19 am

I use FireFox both on linux and windows and it works fine, not sure what could it be.
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Jul 06, 2004
  • Posts: 1890
  • Loc: Las Vegas
  • Status: Offline

Post July 27th, 2005, 2:08 am

Check your Javascript Console. Sometimes when it seems that Ozzu is lagging, it's actually doing the 10-second thing I mentioned above.

Should have mentioned this when I posted, this is on Windows. Under Suse 9.3 I have no problems.
  • sana
  • Expert
  • Expert
  • User avatar
  • Joined: Jul 10, 2004
  • Posts: 592
  • Loc: I am back!!
  • Status: Offline

Post July 27th, 2005, 8:41 am

I am using Firefox on windows , and never encountered this problem.
I love donkeys! I believe one day donkeys shall rule the world. *serious face*
----HexHarryPotter!----
  • sana
  • Expert
  • Expert
  • User avatar
  • Joined: Jul 10, 2004
  • Posts: 592
  • Loc: I am back!!
  • Status: Offline

Post July 27th, 2005, 8:42 am

I am using Firefox on windows , and never encountered this problem.
I love donkeys! I believe one day donkeys shall rule the world. *serious face*
----HexHarryPotter!----
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post July 27th, 2005, 8:49 am

Interesting. I get the lagging from time to time but never associated it with the fader.js. But you are correct. The error is there. My javascript console is loaded with them.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • katana
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 07, 2004
  • Posts: 2390
  • Loc: Edinburgh, Scotland
  • Status: Offline

Post July 27th, 2005, 10:12 am

I've seen this error since waaaaay back - ever since I started using Firefox (about 0.9-ish). Never reported the error as I never thought it was a big deal.
Why do geeks get Halloween and Christmas confused?
Because 31 Oct == 25 Dec
www.darren-king.co.uk
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8925
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post July 27th, 2005, 10:34 am

So if I am understanding correctly this error seems to happens randomly? If any of you can figure out when it happens exactly that would help me duplicate the problem so that I can attempt to fix it.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post July 27th, 2005, 11:54 am

The primary error is this:
Error: hex has no properties
Source File: http://www.ozzu.com/fader.js
Line: 77

The code function is:
Code: [ Select ]
function convert2Dec(hex)
    {    
        var rgb = new Array();
        for (var u = 0; u < 3; u++)
            rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
        return rgb;
    }
  1. function convert2Dec(hex)
  2.     {    
  3.         var rgb = new Array();
  4.         for (var u = 0; u < 3; u++)
  5.             rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
  6.         return rgb;
  7.     }


Other errors:
Error: fader is not defined
Source File: http://www.ozzu.com/fader.js
Line: 130

Code: [ Select ]
function clearFade()
    {
        if (document.layers) return;
        if (fader) clearInterval(fader);
        fader = setInterval("fade(" + x + ", 0)", speed);
    }
  1. function clearFade()
  2.     {
  3.         if (document.layers) return;
  4.         if (fader) clearInterval(fader);
  5.         fader = setInterval("fade(" + x + ", 0)", speed);
  6.     }


Error: document.links[x] has no properties
Source File: http://www.ozzu.com/fader.js
Line: 118

Code: [ Select ]
function findLink(over)
    {
        if (document.layers) return;
        if (fader)
            {
                clearInterval(fader);
                document.links[x].style.color = "#" + ocs[x];
            }
        if (over && !this.id) this.id = over;
        x = 0;
        while (!(this.id == document.links[x].id) && (x < document.links.length))
            x++;
        if (this.id == document.links[x].id)
            {
                oc = currentColour(x);
                fader = setInterval("fade(" + x + ", 1)", speed);
            }
    }
  1. function findLink(over)
  2.     {
  3.         if (document.layers) return;
  4.         if (fader)
  5.             {
  6.                 clearInterval(fader);
  7.                 document.links[x].style.color = "#" + ocs[x];
  8.             }
  9.         if (over && !this.id) this.id = over;
  10.         x = 0;
  11.         while (!(this.id == document.links[x].id) && (x < document.links.length))
  12.             x++;
  13.         if (this.id == document.links[x].id)
  14.             {
  15.                 oc = currentColour(x);
  16.                 fader = setInterval("fade(" + x + ", 1)", speed);
  17.             }
  18.     }


Unfortunately Firefox's javascript console doesn't give the time of the error, so I've cleared my log in an attempt to discover when it happens.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post July 27th, 2005, 12:22 pm

It appears to be random. Same three errors. I was able to initiate the error by mousing over the Meet The Mods Link and I got the error when entering this post to reply. But I wasn't able to consistantly duplicate the errors.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • katana
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 07, 2004
  • Posts: 2390
  • Loc: Edinburgh, Scotland
  • Status: Offline

Post July 27th, 2005, 12:30 pm

I think the error comes about when you "mouse over" a link before the page loads up entirely. If you refresh the page, or click on one of the forums, and then quickly mouse over some links, you'll see the error in the JS console.
Why do geeks get Halloween and Christmas confused?
Because 31 Oct == 25 Dec
www.darren-king.co.uk
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post July 27th, 2005, 12:34 pm

Yes. I can duplicate the errors fairly consistantly that way.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Jul 06, 2004
  • Posts: 1890
  • Loc: Las Vegas
  • Status: Offline

Post July 27th, 2005, 12:35 pm

I see the lag error after replying mostly, I think.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post July 27th, 2005, 12:48 pm

I did get that frequently as well. I seem to be able to duplicate it more consistantly where simple_header.tpl is involved.

//edit -- strike that. I forgot the reply thing uses overall_header.tpl
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 27th, 2005, 12:48 pm

Post Information

  • Total Posts in this topic: 23 posts
  • Users browsing this forum: No registered users and 20 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.