PDA

View Full Version : Script problem in NS...


jaeman
10-29-2003, 12:06 AM
I have a script for a logo to appear in the lower righthand corner, I have been successful with IE but it just doesn't want to work with NS7.

I have tryed about everything i can think of to get it to work with NS, Hopefully someone knows what i have over looked or don't know yet to get it to run in NS.

The code is attached as a zip with a logo included, frustrated... jaeman:rolleyes:

scoutt
10-30-2003, 12:44 AM
for one thing you don't have any head tags. NS is very strict on html thoroughness. and you had some stuff wrong with the netscape part.

jaeman
10-30-2003, 09:36 AM
Yeah thanks scoutt, Was missing the head tag while i was finding what was wrong, I know i should have had it there anyway, Theres no excuse.

But thanks for the help, Funny though, In ns7 it's working but in ns4.78 it doesn't but it did, So i'm going to make a check for the ns ver, Also the way i had it layed out was so if your resize the browser the logo also adjusts it's self in the corner, But resizing with ns7 from max to smaller size it doesn't adjust properly so i had to make the "left_from_corner & up_from_corner " about 15px.

Anyway cheers... jaeman;)

scoutt
10-30-2003, 10:02 AM
you will have to check for that version and do something totally different then what you are doing now. I think NS4.x goes by document.all but can't remember. NS6+ goes by getElementById and IE uses docuemnt.all. if I have this backwards then somebody will correct me. :)

also it may not like the pixels without the px at the end.

Jon Hanlon
10-30-2003, 07:51 PM
Netscape 6+ is more like IE than NN4.
Only IE4+ uses document.all - NS6+ (and IE5+) use getElementById.
NN4 uses nothing much (of any use, anyway).

Personally, I'd stop supporting NN4, but if you want it you can test for it after the others.
Change this code

if(navigator.appName == "Microsoft Internet Explorer")
{
var ld=document.all.logo;

to be

if (document.all || document.getElementById)
{
var ld = (document.all) ? document.all.logo : document.getElementById("logo");

/* An easier way is: var ld = document.images["logo"] */


and move it to before the NN4 test.


You can also locate the element in NN4 using the document.images["logo"] method.

jaeman
11-01-2003, 04:38 AM
Thanks for the feedback, You had it right with doc.all Scoutt & i will use your eg also Jon, Glad to recieve your advice... jaeman;)