Closed Bug 298410 Opened 20 years ago Closed 11 years ago

fujifilm.com - explicitly checks for document.layers and document.all, does nothing if both checks fail

Categories

(Tech Evangelism Graveyard :: Japanese, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: herter, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Goto:
http://home.fujifilm.com/products/EMcontents/p_info/index.pgi
and try to select one of the product groups. In the window 
status bar appear a message that JavaScript function showLAYER()
is being called. 

With IE my Microsof this web page works fine.



Reproducible: Always

Steps to Reproduce:
1.http://home.fujifilm.com/products/EMcontents/p_info/index.pgi
2.Try to select one of the products from the menu on the left.
3.



Expected Results:  
use Internet Explorer to compare
The showLAYER and hideLAYER functions use document.all and document.layers, not
 document.getElementById(). From
http://home.fujifilm.com/products/EMcontents/p_info/js/layerAction.js

function showLAYER(layName){
if(document.layers) document.layers[layName].visibility='show'
if(document.all) document.all(layName).style.visibility='visible'
}

function hideLAYER(layName){
if(document.layers) document.layers[layName].visibility='hide'
if(document.all) document.all(layName).style.visibility='hidden'
}
Explicitly checking for document.layers and document.all automatically excludes
Gecko (on which Firefox and Mozilla are based). Recent versions of Gecko (1.7 -
Firefox 1.0 - included) do support document.all, except for explicit
if(document.all) check.

So you should either remove document.all check and just use document.all
properties and methods by default, i.e.:
  function showLAYER(layName){
    if(document.layers) document.layers[layName].visibility='show'
    else document.all(layName).style.visibility='visible'
  }
or (better) use the standard W3C DOM methods.

Moving over to tech evangelism.
Assignee: nobody → japanese
Status: UNCONFIRMED → NEW
Component: JavaScript Console → Japanese
Ever confirmed: true
Product: Firefox → Tech Evangelism
QA Contact: javascript.console → japanese
Summary: showLAYER('name') does not have any effect, no message why on JavaScript console → fujifilm.com - explicitly checks for document.layers and document.all, does nothing if both checks fail
URL is dead.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.