Solved

Broken img link in Netscape 3.0

Posted on 1998-09-19
8
151 Views
Last Modified: 2013-12-25
I am getting a broken image link on a page in Netscape 3.0 only, works fine in 4.0 of IE and Netscpae. I have run the code thru a validator with no errors showing.

Need help on this one
0
Comment
Question by:GaryZ
  • 4
  • 3
8 Comments
 

Author Comment

by:GaryZ
ID: 1855166
0
 

Author Comment

by:GaryZ
ID: 1855167
0
 
LVL 5

Expert Comment

by:Trevor013097
ID: 1855168
GaryZ,

I believe that the problem is one of the known bugs in Netscape 3.  I think that (and I can't be 100% sure about this as my workaround has failed) we are dealing with multiple reflection here.

The bug is where Netscape 3 reflects a Javascript object multiple times when it is in a nested table.  Your images after adding a debug alert of:

alert(imgDocID.length);

inside your hilite function show that the images length is being reported as 4.  Now your page uses a single nested table and so this reflection should be only once and therefore the length value should be 2, but its 4.

I have a workaround but that workaround doesn't appear to work. And having just tested the workaround in its own code it doesn't work there either (thanks Netscape for the useless fix!!).

The workaround is this:
<!--

 Navigator 3.0X

Images in table cells are reflected into JavaScript twice.
(Or four times if nested in a two-level table, etc.)

     Workaround: use the array that results from multiple reflection in JS, as in this example based on
     Bram Cohen's (bram@earthweb.com) test case:


//-->

        <html>
        <title>Nested Tables with img src Change Bug</title>
                                                <head>
                                                </head>
        <body>
        <table width="100%" height="100%">
        <tr><td align=center valign=middle>
        <table><tr><td><img name="myImage" src="first.gif"></td></tr></table></td></tr>
        </table>
        <script>
        with (document) {
            if (myImage.length){
                myImage[myImage.length-1].src = "second.gif";
            } else {
                myImage.src = "second.gif";
            }
        }
        </script>
        </body>
        </html>

Everything appears to work okay, but if you put in a couple of debug alerts to see which part of the if...else condition gets executed you find out that it is the else, meaning that the reflection doesn't happen, but it should have because the image is within a nested table.

Now your page is giving a very difinate reflection, try this in your page and you'll see what I mean:

function hiLite(imgDocID,imgObjName) {
  if (document.images) {
     alert(imgDocID.length);
     document.images[imgDocID].src = eval(imgObjName + ".src");
  }
}

Now here is where I am stumped because the bug is in my opinion not solvable.  The image you get in your page which is broken is definately an instance of reflection because right-clicking on it does provide an image options like view, save etc.

I think the best thing would be to rewrite the page to have no nested tables.

Sorry I can;t help further.  I'll be interested to see if anyone else has a solution to this.

Trevor.


0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 5

Expert Comment

by:Trevor013097
ID: 1855169
GaryZ,

Please read the 3rd from last paragraph as:

Now here is where I am stumped because the bug is in my opinion not solvable.  The image you get in your page which is broken is definately an instance of reflection because right-clicking on it does   NOT   provide an image options like view, save etc.

Sorry.

Trevor.


0
 
LVL 28

Accepted Solution

by:
sybe earned 300 total points
ID: 1855170
You HAVE a broken image: red_dot.gif. When I ask for it, then I get the message, that that file is not present on the server.

The reason that it shows in NS3, is that NS3 shows a very clear broken image sign. The other browser you mention don't have such an ugly broken image sign.

Your HTML code is not the reason, and there is no bug in NS3. Just put red_dot.gif on the server.
0
 
LVL 5

Expert Comment

by:Trevor013097
ID: 1855171
sybe,

Well, I don't know.  Trying to find something more complicated than was actually the case.  Hey who would have thought a missing image was a 300 pointer? Suppose that's why I was looking deeper.

>> "Your HTML code is not the reason, and there is no bug in NS3."

NS3 does have a bug with nested tables (a well known bug).


Trevor.


0
 

Author Comment

by:GaryZ
ID: 1855172
Boy did I miss that one. It has had me bugged for 2 weeks. I thought it was having a problem with white.gif

Thanks a lot.
0
 

Author Comment

by:GaryZ
ID: 1855173
The reason it was worth 300 was I needed an answer NOW :-)

I have to have the site up tomorrow.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now