Closed Thread Icon

Topic awaiting preservation: script not running under mozilla (netscape) browser! plz help (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8535" title="Pages that link to Topic awaiting preservation: script not running under mozilla (netscape) browser! plz help (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: script not running under mozilla (netscape) browser! plz help <span class="small">(Page 1 of 1)</span>\

 
dipree
Nervous Wreck (II) Inmate

From:
Insane since: Feb 2003

posted posted 02-17-2003 20:38

Hi!

My script is well working under IE but it must also run under mozilla!
Nobody can help me until now, however i found this forum and it looks
very serious.
No more explanations u can find out more on ur own!
www.vx-media.de/notepad/ <--- url where i used the javascript


function ToggleFrontNews (id)
{
if (document.all.item("FrontNewsRow_" + id).style.display == 'none')
{
document.all.item("FrontNewsImg_" + id).src = "http://www.vx-media.de/notepad/gfx/collapse.gif";
document.all.item("FrontNewsRow_" + id).style.display = "inline";
document.all.item("FrontNewsImg_" + id).alt = "Hier klicken um die weiteren Infos zu verstecken";
}
else
{
document.all["FrontNewsImg_" + id].src = "http://www.vx-media.de/notepad/gfx/expand.gif";
document.all["FrontNewsRow_" + id].style.display = "none";
document.all["FrontNewsImg_" + id].alt = "Hier klicken um die weiteren Infos anzuzeigen";
}
}

plz tell me how i can fix it!

thx so far

greetings dipree

trib
Paranoid (IV) Inmate

From: Den Haag, Netherlands
Insane since: Sep 2002

posted posted 02-17-2003 21:09

Many years ago, when even I was a lad, there was a test for browsers you could include in your Javascript .. it went like this ...

code:
if (document.all) {
IE4 = true;
}
else {
IE4 = false;
}

if (document.layers) {
NS4 = true;
}
else {
NS4 = false;
}



I guess you can see from that that you shouldn't expect document.all to work in Netscape ... ever ... Did you actually do any of your own research before popping up with a question here? coz I don't know of any DHTML coder who doesn't know about document.all ....

I won't spoil your fun by telling you how to solve your problem, but I think you'll probably guess that you'll need to find out what the full NS replacement for document.all is ... and while you're at it, look at the newer browser code too ... like document.getElementByID() which promises to work on most new (gecko-based) borowsers.

If you can follow OO javascript, take a look at Doc. Ozones Znippets page ( http://www.znippets.com ) and pick apart his Zobject.js and Zprime.js scripts to see how you can build fairly robust, cross-browser code with the minimum of hassle. Otherwise, seatch google for cross browser compatibility javascript ... I got > 10 pages of references ...

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-17-2003 21:37
quote:
document.getElementByID() which promises to work on most new (gecko-based) borowsers



document.getElementById() now works in any browser worth writing JavaScript for. I suggest you look into it. document.all and document.layers should not appear in your code unless it is *crucial* that your page works in 5-year-old browsers.

dipree
Nervous Wreck (II) Inmate

From:
Insane since: Feb 2003

posted posted 02-17-2003 21:44

i am a newbie at javascripting i doesnt even know something about it and i never cared about netscape!
thats why it doesnt work at NE! i thought anyone knows how to fix it quick or telling me an alternative which provides the same results for all browers as my script!

dipree
Nervous Wreck (II) Inmate

From:
Insane since: Feb 2003

posted posted 02-17-2003 21:48

function ToggleFrontNews (id)
{
if (document.getElementById("FrontNewsRow_" + id).style.display == 'none')
{
document.getElementById("FrontNewsImg_" + id).src = "http://www.vx-media.de/notepad/gfx/collapse.gif";
document.getElementById("FrontNewsRow_" + id).style.display = "inline";
document.getElementById("FrontNewsImg_" + id).alt = "Hier klicken um die weiteren Infos zu verstecken";
}
else
{
document.[butwhattoputhere]???["FrontNewsImg_" + id].src = "http://www.vx-media.de/notepad/gfx/expand.gif";
document.all["FrontNewsRow_" + id].style.display = "none";
document.all["FrontNewsImg_" + id].alt = "Hier klicken um die weiteren Infos anzuzeigen";
}
}


dipree
Nervous Wreck (II) Inmate

From:
Insane since: Feb 2003

posted posted 02-17-2003 21:51

I'M DAMM LAME

trib
Paranoid (IV) Inmate

From: Den Haag, Netherlands
Insane since: Sep 2002

posted posted 02-19-2003 13:53

Can I suggest that you start by learinng a little javascript.???

Implementing "neat" scripts which you copy down from someone else's web site, and which you don't understand is just a recipe for disaster later in the life of your web site. If you can't fix them when they break, you end up stuck.

I believe (correct me if I'm wrong someone) that this forum is for experienced programmers to help less experienced programmers, not a site where you can dump a script and get it fixed. Show some sign that you know what you're doing and you'll probably find people queueing up to show you how smart they are ... on the other hand, show them you're clueless and that you expect someone to fix your problem, and at best you'll only find that people make an effort to avoid bothering to answer your questions, and at worst, someone will start getting pissy and rude about it.

Do yourself a favour ... learn how to do it yourself, and then come back with problems you encounter along the way ... then I'll help, and I'm sure a lot of other people (much smarter than me) will as well.

2c




[This message has been edited by trib (edited 02-19-2003).]

trib
Paranoid (IV) Inmate

From: Den Haag, Netherlands
Insane since: Sep 2002

posted posted 02-19-2003 14:11
quote:
i thought anyone knows how to fix it quick or telling me an alternative which provides the same results for all browers as my script!


I DID tell you how to find the alternative to make it cross browser. However, it will take some understanding and work on your part to make it work. Go to http://www.znippets.com and look at Doc's publically available code for one way of how to do it ... like I suggested in the first place ... did you try that already ?? did you read any of the code from there ??

You did ?? Ok then - now go and look at http://www.xs4all.nl/~ppk/js/index.html for everything you will ever need to know (for now) about DOm and Javascript code compatibility ...

Finally ... if you really want to be initiated into the deepest secrets of the Ozone brotherhood, you can try our own very special "all the secrets in one place" site (known only to a few of the most secret initiates of the Ozone Asylum and until now never shared with strangers - do not reveal this site to anyone else - even under torture) here it is. (this link will self-destruct in 5 seconds)

[This message has been edited by trib to remove most of the bitter irony and sarcasm (edited 02-19-2003).]

[This message has been edited by trib (edited 02-19-2003).]

« BackwardsOnwards »

Show Forum Drop Down Menu