In article < >,
enlightened us with...
> Hi all,
>
> I am green in javascripts,
Want some constructive advice then?
Stop doing browser detection.
> <script language="javascript">
The language attribute is deprecated in favor of the type attribute. If you
have to support old browsers, it doesn't hurt to use both.
<script type="text/javascript" language="javascript">
> if (document.layers) {
> document.write("<img src='" + pics[0] + "' border=1 width=760
> height=600 name='displayPic'>");
Are you sure that's what you want?
I'm not sure where in the page this script is running, but usually one sees
document.layers["layername"].document.write("some string");
for NN4.
>
> function showPic(whichPic,whichSize) {
> theSize = whichSize;
> if (whichSize == "small") {
> var content = "<img src='"+picsS[whichPic]+"' border=1
> name='displayPic'>";
> }
This really isn't the best way to make new pics.
Let me know if you are curious about alternatives using createElement or new
Image().
> else {
> var content = "<img src='"+picsL[whichPic]+"' border=1
> width=760 height=600 name='displayPic'>";
> }
> }
> if (isIE) {
> document.all("picDiv").innerHTML = content;
I don't know what isIE is, but Opera also supports document.all.
This is better:
if (document.all && !document.getElementById)
document.all("picDiv").innerHTML = content;
> }
> if (isNS6) {
> document.getElementById("picDiv").innerHTML = content;
I don't know what isNS6 is, but this is better:
if (!document.all && document.getElementById)
document.getElementById("picDiv").innerHTML = content;
> }
> showPicTime(whichPic);
What is this function doing? Hard to trace problems without all the code.
> }
>
> I found that the same image will show twice ( they lies upward and
> downward ) on the page when using netscape 7.0 but it will not when
> using netscape 7.2 or IE.
7.0 is buggy. I've had numerous problems with it.
I'd need to see a full testable page to play with to say any more about that.
Got a URL with a full test example?
My guess: it's appending instead of replacing. But I dunno for sure.
--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace