Closed Bug 247395 Opened 20 years ago Closed 17 years ago

TBODY ID Not Evaluated By "eval" Function

Categories

(Tech Evangelism Graveyard :: English US, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kevinbe71, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9

In the last 1/3 of the page the section "Sample code in C#" has a "Show Code"
link.  When you click on this you get no response (i.e. it doesn't expand as it
should).  When viewing this in other browsers (IE 6, Konqueror and AFAICR Opera)
it works fine.  It complains about this javascript:

   if (eval(ref).style.display =='none')
//     (where ref = 'Structure')

The error given is "Structure" is not defined.

"Structure" is a TBODY HTML element with the ID defined as follows:
    <TBODY ID="Structure" style="DISPLAY:none">


Reproducible: Always
Steps to Reproduce:
1. Visit web page.
2. Click on "Show Code" link in Konqueror / IE 6.  Observe code is shown, then
hidden.
3. Click on "Show Code" link in Mozilla Firefox 0.9 or other Mozilla browser and
observe that code is not shown and javascript error is logged in console.

Actual Results:  
"Show Code" didn't work - no text expanded.  Javascript error in console.

Expected Results:  
Text should have been expanded.

I have asked the owner's of this site repeatedly to change their pages but they
will not do it.  I have also observed this issue when debugging ASP.NET apps -
Microsoft themselves use this kind of code to show and hide text.  So this may
even affect most ASP.NET apps that provide this functionality.  Therefore this
is a serious issue that should be addressed ASAP.
Attached file Offending Web Page
added the web page as an attachment in case it isn't available when bug is
being reviewed.
that's an ieism.
you should do:
structure=document.getElementById("Structure")
Assignee: general → english-us
Component: DOM → English US
Product: Browser → Tech Evangelism
QA Contact: ian → english-us
Version: Trunk → unspecified
NOTE: Although this may be an "ieism" as one response indicated...  this is not
a fault of the web site developer per se...  take a look at the top of this HTML
doc.  It indicates that the code was generated by Visual Studio (see code
snippet below).  I think that means that VS generated the code- and not the
user.  So, if this is not fixed in Mozilla it will have to be fixed by
Microsoft.  They probably don't care about changing it because they're
interesting in IE dominating the web anyway.  So, I think it is still important
that this behavior is changed in Mozilla.  Especially because Opera and
Konqueror support it.  It has become a defacto standard even if it isn't a W3C
standard.

  <HEAD>  
  <title>Design Patterns: Bridge</title>
  <link rel="stylesheet" type="text/css" HREF="..\DoFactory.css" >
  <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
  <meta name="CODE_LANGUAGE" Content="C#">
  <meta name=vs_defaultClientScript content="JavaScript">
  <meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
  </HEAD>
The site works as expected.

This bug should be closed.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: