Hi,
I need help : I found the simplest and most precise way to open and close
submenu layers. it works perfectly with IE, but for some odd reason NS won't
recognize it.
Can anyone tell me why ?
And is there a way around the problem ?
I really like the elegance of this code and would like to keep using it.
Thanks in advance.
Roger Desparois
<head
<script language="Javas cript"`>
<!--
function Pop(name){
eval("document. all."+name+".st yle.visibility= 'visible'");
}
function Wop(name){
eval("document. all."+name+".st yle.visibility= 'hidden'");
}
//-->
</script>
</head>
<body>
<div id="prod"
Style="backgrou nd-color:#ff0000;P osition:Absolut e;Left:39px;Top :89px;Width:1
78px;Height:16p x;Visibility:vi sible;z-index:31" onmouseover="Po p('smprod')"
onmouseout="Wop ('smprod')">
<table width="178" height="16" border="0" cellspacing="0" cellpadding="0"
class="menu">
<tr>
<td align="center" valign="middle" >Volleyball</td>
</tr>
</table>
</div>
<div id="smprod"
Style="backgrou nd-color:#ff0000;t ext-align:right;Pos ition:Absolute; Left:39px
;Top:105px;Widt h:178px;Visibil ity:hidden;z-index:32"
onmouseout="Wop ('smprod')" onmouseover="Po p('smprod')">
<table width="178" border="0" cellspacing="0" cellpadding="0" class="menu">
<tr>
<td><img src="../images/espace1px.gif" width="178" height="5"></td>
</tr>
<tr>
<td align="center" valign="top">
<a href="../volleyball/en-ballons.html">B alls</a><br>
<a href="../volleyball/en-souliers.html"> Shoes</a><br>
<a href="../volleyball/en-genouillere.htm l">Kneepads</a><br>
<a href="../volleyball/en-chevillere.html ">Ankle braces</a><br>
<a href="../volleyball/en-filets.html">Ne ts</a><br>
<a href="../volleyball/en-accessoires.htm l">Accessori es</a></td>
</tr>
<tr>
<td><img src="../images/espace1px.gif" width="178" height="5"></td>
</tr>
</table>
</div>
</body
Jul 23 '05
26 2231
> Netscape 4 is this: ns4 = (document.layer s); //ns4 = true if Netscape 4
Of course it is totally ancient history by now, so just in respect to the
Great_Olds (meaning NN4x series :-)
:
document.layers was a collection of all layers on the given page. So the
call document.layers gives you the length of this collection. Usually at
least one layer was presented, so it casted nicely to true. But without any
layers it gave you false (0 -> false).
That was the rare case then it was better to use navigator.userA gent and
parseFloat to get the particular build.
I believe by 4.72 they fixed it so document.layers <> document.layers .length
(default property call), but nobody cared too much at that time anyway.
JRS: In article <ck************ *******@news.de mon.co.uk>, dated Mon, 11
Oct 2004 13:38:02, seen in news:comp.lang. javascript, Mark Preston
<us****@nosourc e.co.uk> posted : Please note that the PR version of the final Firefox will also support "document.al l" for compatibility with poorly written code. Not, I feel, a good idea but certainly an understandable move.
If document.all is present in addition to document.getEle mentById
and/or document.layers then ISTM that multi-browser code which tests
for such entities should be reviewed to see whether the tests are
correctly prioritised.
I believe that the code in FAQ 4.15, and the code that was earlier there
and recognised document.layers , will pass that review.
My version of that earlier code is probably OK as is, but I see in it
some commented-out warning code ...
Perhaps someone could check <URL: http://www.merlyn.demon.co.uk/js-
date2.htm#RC> in the PR version, just to see whether running text-
clocks appear.
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Dr John Stockton wrote:
<--snip--> Perhaps someone could check <URL:http://www.merlyn.demon.co.uk/js- date2.htm#RC> in the PR version, just to see whether running text- clocks appear.
Yes, it appears. The entire section appears the same to me in IE6 SP2 as
is it does in Firefox PR
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
"Dr John Stockton" wrote: Mark Preston posted : Please note that the PR version of the final Firefox will also support "document.a ll" for compatibility with poorly written code. Not, I feel, a good idea but certainly an understandable move.
If document.all is present in addition to document.getEle mentById and/or document.layers then ISTM that multi-browser code which tests for such entities should be reviewed to see whether the tests are correctly prioritised.
The Mozilla authors have taken the (in my opinion bad, and strange)
decision to implement - document.all - such that it is not detectable
(by typeof or type-converting) so properly structured feature detecting
code will never notice it.
If by prioritised you mean which of the various methods should be the
preferred choice for element reference retrieval,I would still go with -
document.getEle mentById -, not because it is W3C standard but because it
is the most well defined, and limited, in the behaviour that should be
expected of it. It is possible to add code that will make -
document.all - behave exactly like gEID, but emulating all of -
document.all - on W3C standard only browsers (are there any of those
left now?) is a lot more involved than writing:-
document.all = document.getEle mentByTagName{' *');
Richard.
Richard Cornford wrote: The Mozilla authors have taken the (in my opinion bad, and strange) decision to implement - document.all - such that it is not detectable (by typeof or type-converting) so properly structured feature detecting code will never notice it.
I am not defending their decision, but I would imagine the Mozilla authors'
rational for the - document.all - behaviour to be something akin to:
By supporting - document.all - in a way that is not detectable in properly
structured feature detecting code, they eliminate the possibility that the
less-well-supported document.all path will be chosen. However, if the script
is so badly written that it simply assumes document.all will be available,
the code (hopefully) won't fail.
In other words they want the W3C-compatible path taken when presented with:
if (document.all) {
// path not taken by FF 1.0PR
}
if (document.getEl ementById) {
// path taken by FF 1.0PR
}
but they want something like this to work
<script language="JavaS cript1.2">
<!--
// badly written JavaScript here
document.all.my Div.style.color = 'Red';
//-->
</script>
Personally I think supporting - document.all - will just perpetuate poorly
written code, but I can understand why they have chosen to support it, even
in a limited fashion. They have probably simply gotten tired of being told
their browser is "broken" because it does not work on the many, many, many
poorly authored sites that cater solely to Internet Explorer.
--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Grant Wagner wrote: Richard Cornford wrote: The Mozilla authors have taken the (in my opinion bad, and strange) decision to implement - document.all - such that it is not detectable (by typeof or type-converting) so properly structured feature detecting code will never notice it. I am not defending their decision, but I would imagine the Mozilla authors' rational for the - document.all - behaviour to be something akin to:
By supporting - document.all - in a way that is not detectable in properly structured feature detecting code, they eliminate the possibility that the less-well-supported document.all path will be chosen.
This move makes it questionable as to the extent to which -
document.all - is less well supported (at least when all the gecko users
have updated). Of the scriptable W3C DOM standard dynamic visual
browsers; IE 5+, Opera 7, Konqueror, Safari, Gecko browsers, IceBrowser
and probably others, will support - document.all -, along with less
dynamic W3C browsers like NetFront and Opera 6 (more or less). And with
IE 4 falling into the - document.all - only camp (and probably not being
alone there), Mozilla's decision might have swing the numbers away from
gEBI.
It is a bit like - innerHTML -, it is not DOM standard but it is very
well supported and so difficult to justify not using it on the grounds
that it is not standard.
<snip> Personally I think supporting - document.all - will just perpetuate poorly written code, but I can understand why they have chosen to support it, even in a limited fashion. They have probably simply gotten tired of being told their browser is "broken" because it does not work on the many, many, many poorly authored sites that cater solely to Internet Explorer.
I agree with your proposed motivation, and that it will perpetuate
poorly written code, but I suspect that denying the possibility of
detecting an implemented feature will act to undermine feature detecting
itself and encourage an attitude of charging in with code that "woks"
and never addressing the consequences of its failure.
Personally I don't mind whether Mozilla implements it or not, I am not
going to prefer to use it because it is more chaotic in its behaviour
than gEBI (returning collections sometimes and allowing at least three
distinct methods of indexing its contents (at latest on the latest
IEs)). But if it is there it should be possible to know that it is
there.
That would however be near catastrophic because of the:-
isNet6Plus = Boolean(documen t.getElementByI d && !document.all);
isIE5Plus = Boolean(documen t.getElementByI d && document.all);
- style browser detecting that is so (misguidedly) pandemic.
In any event the decision appears to have been made so the consequences
may eventually become apparent.
Richard.
Richard Cornford wrote: Grant Wagner wrote: By supporting - document.all - in a way that is not detectable in properly structured feature detecting code, they eliminate the possibility that the less-well-supported document.all path will be chosen.
This move makes it questionable as to the extent to which - document.all - is less well supported (at least when all the gecko users have updated). Of the scriptable W3C DOM standard dynamic visual browsers; IE 5+, Opera 7, Konqueror, Safari, Gecko browsers, IceBrowser and probably others, will support - document.all -, along with less dynamic W3C browsers like NetFront and Opera 6 (more or less). And with IE 4 falling into the - document.all - only camp (and probably not being alone there), Mozilla's decision might have swing the numbers away from gEBI.
It is a bit like - innerHTML -, it is not DOM standard but it is very well supported and so difficult to justify not using it on the grounds that it is not standard.
Besides, the 'all' method is not only applicable to the document object,
but too any HTML element, too, thus permitting to find an element with a
requested ID in only a subtree of the document. I find this useful when
generating complex nodes from (DOM, or textual) templates: I needn't
care about uniquifying (?) all ID attributes, but at most, only the ID
of root template elements.
Cheers,
Alexis
--
some domain is free This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: 2obvious |
last post by:
This is a pipe dream, I realize, but I'm trying to emulate the
functionality of the W3C DOM-supported document.getElementsByTagName
method under the very nightmarish Netscape 4.
Through some sleuthing, I was able to find what serves as a
document.getElementById emulator at
http://www.xs4all.nl/~ppk/js/dhtmloptions.html#versionb.
(Below is the code; this clever algorithm is painstakingly explained
at the site above.)
|
by: Federico Bari |
last post by:
Good morning all from italy,
i have probably a compatibility problem with a html/javascript page.
The aim of the code of the file test.htm you find here following (copy the
3 files in the
same directory) is to change the content of a layer, created with the
<div...> tag, with an external text (clicking over an hiperlink) or with the
result of a <form...> submition. The solution (I haven't been able to find
anyone else) is to use a...
|
by: Simon Wigzell |
last post by:
I pulled some 3rd party code off the internet that makes a span visible on
mouseover of a link. It works fine in IE, doesn't work for Netscape, it goes
into "Unknown", see it here :
http://www.studioapriori.com/cavendishSimon/divtest.htm How can I make it
work for all browsers? (Within reason of course!)
<html>
<head>
<style type="text/css"><!--
..absolute { position:absolute; visibility:hidden; }
|
by: Jon |
last post by:
Hi,
I have a function that uses the following line:
var level = document.getElementById( id);
I also know the name of the element I am looking for. In Netscape
Communicator 4.7, however, this doesn't work... What can I do to get
the same element in this browser? Thanks!
|
by: kaeli |
last post by:
Can anyone explain this to me? It's driving me insane.
Save this and run it in IE or Opera and then in Mozilla or Netscape 6+.
In IE/Opera, I get the expected 4 alerts.
In Mozilla/Netscape, I get *9*.
In the example table, there are 4 rows with 4 columns each in the tbody.
I'd expect 4 child nodes for the table body with 4 children each. I get
those 4 plus 5 alerts in Mozilla/Netscape. I get only
those 4 in IE and Opera. Note that...
| |
by: Don |
last post by:
I can successfully force submission of a <form> using "document.formname.submit()". But, the
submission doesn't appear to occur when used with Netscape. Anybody know why this is happening, and
what I can do to get around this?
Thanks,
Don
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
|
by: VK |
last post by:
<http://browser.netscape.com/ns8/>
The biggest hecs:
Two totally separate, including scripting, parsing engines:
Mozilla/Firefox (called "Netscape") and Internet Explorer. User can
choose any of them for permanent use, but by default IE is chosen.
Unless some engine is chosen for permanent use by user, the browser
will switch the engines from site to site based on the predefined list
|
by: Kristoffer Arfvidson |
last post by:
HI!
I have a question....
when designing asp.net pages in vs.net I always see that labels are
transformed to <span tags...
I stopped using span and div before because of its lack of compatibility
with netscape...
However, in asp.net it dosn´t seem to be an option...
Do you guys know how compatible an asp.net page is with other browsers such
|
by: MLibby |
last post by:
I'm a Netscape newbie and am using it for backward compatibility testing.
How do I debug javascript in Netscape? I set Netscape as the default
debugger (design mode | file | Browse With) and I am able to debug code
behind. However, when I try to debug the .js file the debugger doesn't hit
the breakpoints!
Any ideas?
Mike
--
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |