1
LeeStewart
JavaScript error in admin Control Panel
  • 2004/8/29 2:51

  • LeeStewart

  • Just popping in

  • Posts: 10

  • Since: 2004/8/29


I'm not 100% sure of the cause, but there's Javascript problem on IE 6 (probably other browsers as well). My development machine is set up to display errors - I can ignore the problem and it continues fine.

I reproduce the problem by going to the admin Control Panel and clicking the yellow buttons on the left. Sometimes a page is loaded and there's a problem with the PHP Layers Menu (layersmenu.js): Error on line 25 - Object Expected

The problem is on the underscored line:
} else if (IE4 && DOM && !Opera5 && !Konqueror) {
    [
b][u]currentY += document.body.scrollTop;[/u][/b]
}

As a test, I added a line before that:
} else if (IE4 && DOM && !Opera5 && !Konqueror) {
    if (!
document.bodyalert("what the heck?");
    
currentY += document.body.scrollTop;
}

The alert() pops up every once in a while - it looks like this JavaScript callback is being executed before the page is fully loaded.

To get around the problem, I check for the existence of the document.body object before dereferencing it:
} else if (IE4 && DOM && !Opera5 && !Konqueror) {
    if (!
document.body) return
    
currentY += document.body.scrollTop;
}

I'm not sure if anyone else has run into this, but I thought I'd share with everyone...

Login

Who's Online

291 user(s) are online (166 user(s) are browsing Support Forums)


Members: 0


Guests: 291


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits