Change img dynamically works IE not NS6

J

jhahn

I am trying to change the image in a TD with a file input.
This works great in IE but I can't get it to work in NS6+(the page
will only be accessible to NS6+).
Code Snippet:
<HTML><HEAD>
<TITLE>Test Image</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function addImage(){
var daImage
daImage = document.FinalForm.imgInput.value;
// following is one line
document.getElementById('container').innerHTML = '<IMG
SRC=\"'+daImage +'\" WIDTH="335" HEIGHT="188" >';
}
</SCRIPT></HEAD>

<BODY>
<TABLE WIDTH="335" BORDER="1" HEIGHT="188" ALIGN="LEFT" ID="imFile"
BGCOLOR="#FFFFFF">
<TR>
<TD ID="container" HEIGHT="178" TITLE="Left click on entries to drag">
</TD>
</TR>
</TABLE>
<FORM Name="FinalForm">
<INPUT TYPE="FILE" ID="imgInput" NAME="UplFile"
ONCLICK="document.getElementById('imgOK').style.visibility='visible';">
<INPUT TYPE="BUTTON" ID="imgOK" VALUE="OK"
ONCLICK="addImage();document.getElementById'imgOK').style.visibility='hidden';"
STYLE="visibility:hidden">
</FORM>
</BODY>
</HTML>
THank You
 
T

Thomas 'PointedEars' Lahn

Randy said:
What is nonsense is your belief that people who say "the page will only
be accessible to NS6+" are relying on the userAgent string to identify
it, which is NOT the only way to find it. Learn the difference.

There is no reliable way to identify a user agent as Netscape 6+, using
the User-Agent header (or navigator.userAgent) or not. STFW, RTFM.


PointedEars
 
R

Randy Webb

Thomas said:
There is no reliable way to identify a user agent as Netscape 6+, using
the User-Agent header (or navigator.userAgent) or not. STFW, RTFM.

I never said it *was* possible to identify it via the user-agent header
or the navigator.userAgent string. What I said was your assumption that
anybody that says "only accessible to browser XXX" is relying on the
user Agent string was a nonsense argument. And yes, I can differentiate
NS6 from other browsers, and without using the userAgent string.

What you need to do is learn to read what is typed, learn to understand
it, and then read it.

And, I will give you a chance to prove me wrong. Want the opportunity? I
have a page that is *only accessible* to NS6. Care to take the
challenge? If you can open it with any browser other than NS6, you win.
How confident are you?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top