Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Netscape and Javascript
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  08:18:35  Show Profile
Alright .. for the first time (I know .. bad designer!) I'm testing my site in Navigator. So I download the latest Navigator, but Javascripts on my page don't seem to run. Any idea?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 14 January 2003 :  08:22:31  Show Profile  Visit Kat's Homepage
It's Netscape?

KatsKorner

Installation Help | Snitz Mods | Forum Hosting
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  08:25:13  Show Profile
Hehe .. thanks Kat. I'm going to try rebooting my system first .. maybe the installation needs it.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 14 January 2003 :  08:31:25  Show Profile  Visit Kat's Homepage
Sorry Nikkol, couldn't resist..

As regards your script, certain things are not valid in Netscape, such as document.all for example. Have you used anything that Javascript cannot handle? I know it is a very generic question.

Also, are you trying to do any collapsing / showing?

KatsKorner

Installation Help | Snitz Mods | Forum Hosting
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  08:31:39  Show Profile
Nope didn't work. It says "Transferring data from www.mywebsite.com..." in the status bar. What's that mean?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 January 2003 :  08:51:04  Show Profile
Looks like you didn't change one of the default variables in the script. Is it a downloaded script or one you wrote yourself? Would it be possible to post it here for us to look over?


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  08:54:44  Show Profile
Yeah ... perhaps .. but I want to figure this one out for myself if I can ... not too good at javascript and I can stand to learn. This is what I've figured out so far. I need to detect the browser first. What's the best way to do that. The script is executed when an element is clicked. So, it grabs the name of the element and will expand a previously hidden element as well as change the source of an image. My main problem I believe is the difference between IE and Netscape javascript. Any one got any good sources where I can learn?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 14 January 2003 :  09:01:44  Show Profile  Visit Kat's Homepage
You could try looking at irt.org. There is a JavaScript section on there that is pretty good. Ignore the popups - they are a pain but the resource is good.

KatsKorner

Installation Help | Snitz Mods | Forum Hosting
Go to Top of Page

Bookie
Average Member

USA
856 Posts

Posted - 14 January 2003 :  09:43:24  Show Profile  Visit Bookie's Homepage  Send Bookie an AOL message  Send Bookie a Yahoo! Message
I had some problems with this sort of thing in Netscape. Under the tools menu (I think) there is a javascript console that will tell you any errors you are receiving on your page.

The specific problem I ran into is with form elements but the problem might translate to other objects as well. In javascript I would reference a form element like formname.something.somethingelse. Well, Netscape couldn't find formname so I had to include document in front of it like document.formname.etc. Maybe that will help.

Participate in my nonsense
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  09:49:09  Show Profile
what I've got is a table row that has an id. I want to be able to hide and show it when something else is clicked. i can get it to work in ie, but not netscape. how do you reference an element with an id in netscape?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  10:16:36  Show Profile
okay, i got the hide and show working, except in Netscape once it hides, it does not collapse the table row... any suggestions?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 January 2003 :  10:20:19  Show Profile
I have something similar on one of the sites I'm working on at the moment. It uses divs rather than table cells, but the principles should still be the same. First off you'll need to create a class in your stylesheet for the elements you wish to show/hide and set the variables to whatever you want the default to be. Then you'll need to do is grab the user's browser type. There's a great browser sniffer script over at BrotherCake's but it's probably a bit over the top for this situation. A quicker way of doing it would be something along the lines of:
var isExp;
var isMoz;
var isNav;
if(document.all){
 isExp=1;
}
if(document.getElementById&&!document.all){
 isMoz=1;
}
if(document.layers){
 isNav=1;
}

To make the element visible, use the code below, replacing "object_id" to suit your needs:
if(isExp){
 document.all#91;"object_id"#93;.style.visibility = "visible";
}
if(isMoz){
 document.getElementById("object_id").style.visibility = "visible";
}
if(isNav){
 document.layers#91;"object_id"#93;.visibility="show";
}

Similarly, to hide the element, you would use:
if(isExp){
 document.all#91;"object_id"#93;.style.visibility = "hidden";
}
if(isMoz){
 document.getElementById("object_id").style.visibility = "hidden";
}
if(isNav){
 document.layers#91;"object_id"#93;.visibility="hide";
}

Hope this goes some way towards solving your problem.



Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 14 January 2003 10:21:45
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 January 2003 :  10:32:36  Show Profile
quote:
Originally posted by Nikkol

okay, i got the hide and show working, except in Netscape once it hides, it does not collapse the table row... any suggestions?
D'oh! Was still typing my reply when you posted that!

Looks like you're showing/hiding the table cell which won't collapse the row, you'll need to give the id to the <tr> tag rather than the <td>.



Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  10:32:55  Show Profile
This is what I have. And here are the quirks. Works great in IE. The expand works in Netscape, except it messes with text alignment for some reason. The collapse part sorta works in Netscape ... it hides the text, but does not collapse the table row. I might have to switch to divs if I can't get the table thing working.

<script language="javascript">
function expandIt(element) {
	if (IE4==1) {
		whichEl = eval("document.all." + element + "menu");
		whichIm = eval("document.all." + element + "img");
	} else {
		whichEl = document.getElementById(element+"menu");
		whichIm = eval("document.images[element+'img']");
	}
		if (whichEl.style.display == "none") {
			whichEl.style.display = "block";
			whichIm.src = "images/collapse.gif";
		}
		else {
			whichEl.style.display = "none";
			whichIm.src = "images/expand.gif";
		}
}
</script>


BTW ... the id is in the tr tag.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~

Edited by - Nikkol on 14 January 2003 10:33:58
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 14 January 2003 :  10:36:05  Show Profile
also, how come cursor:hand doesn't work in Netscape?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 January 2003 :  10:45:30  Show Profile
Very odd indeed! I can't see anything wrong with your javascript; if expand works then so should collpase... It's got me stumped... Is the javascript console showing any errors?

If you convert from a table to divs, there's nothing to say that you won't encounter the same problem.

BTW, Try using cursor:pointer for Netscape



Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 14 January 2003 10:46:26
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.45 seconds. Powered By: Snitz Forums 2000 Version 3.4.07