Netscape兼容性 [英] Netscape compatibility

查看:65
本文介绍了Netscape兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我需要帮助:我找到了最简单,最精确的方式来打开和关闭

子菜单层。它与IE完美配合,但由于一些奇怪的原因,NS不会

认出它。


谁能告诉我为什么?


有没有解决这个问题的方法?


我非常喜欢这段代码的优雅,并希望继续使用它。


先谢谢。

Roger Desparois

< head

< script language =" Javascript"`> ;

<! -

函数Pop(名称){

eval(" document.all。" + name +" ; .style.visibility =''visi ble''");

}

函数Wop(名称){

eval(" ; document.all。" + name +" .style.visibility =''hidd en''");

}


// - >

< / script>

< / head>


< body>

< div id =" prod"

Style =" background-color:#ff0000;位置:绝对;左:39px;上:89px;宽度:1

78px;高度:16px的;能见度:可见; z索引:31" onmouseover =" Pop(''smprod'')"

onmouseout =" Wop(''smprod'')">

< table width = QUOT; 178"高度= QUOT; 16"边界=" 0" CELLSPACING = QUOT; 0" cellpadding =" 0"

class =" menu">

< tr>

< td align =" center" ; valign =" middle">排球< / td>

< / tr>

< / table>

< / div>


< div id =" smprod"

Style =" background-color:#ff0000; text-align:right; Position:绝对;左:39px

;上:105px;宽度:178px;可见性:隐藏; z-index:32"

onmouseout =" Wop(''smprod' )" onmouseover =" Pop(''smprod'')">

< table width =" 178"边界=" 0" CELLSPACING = QUOT; 0" CELLPADDING = QUOT; 0" class =" menu">

< tr>

< td>< img src =" ../ images / espace1px.gif"宽度= QUOT; 178" height =" 5">< / td>

< / tr>

< tr>

< td align = QUOT;中心" valign =" top">

< a href =" ../ volleyball / en-ballons.html"> Balls< / a>< br>

< a href =" ../volleyball / en-souliers.html">鞋子< / a>< br>

< a href =" ../ volleyball / en-genouillere.html"> Kneepads< / a>< br>

< a href =" ../volleyball / en-chevillere.html">踝关节支撑< / a>< br>

< a href =" ../ volleyball / en-filets.html"> Nets< / a>< br>

< a href =" ../volleyball / en-accessoires.html">附件< / a>< / td>

< / tr>

< tr>

< td>< img src =" ../ images / espace1px.gif"宽度= QUOT; 178" height =" 5">< / td>

< / tr>

< / table>

< / div>

< / body

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="Javascript"`>
<!--
function Pop(name){
eval("document.all."+name+".style.visibility=''visi ble''");
}
function Wop(name){
eval("document.all."+name+".style.visibility=''hidd en''");
}

//-->
</script>
</head>

<body>
<div id="prod"
Style="background-color:#ff0000;Position:Absolute;Left:39px;Top:89px ;Width:1
78px;Height:16px;Visibility:visible;z-index:31" onmouseover="Pop(''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="background-color:#ff0000;text-align:right;Position:Absolute;Left:39px
;Top:105px;Width:178px;Visibility:hidden;z-index:32"
onmouseout="Wop(''smprod'')" onmouseover="Pop(''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">Balls</a><br>
<a href="../volleyball/en-souliers.html">Shoes</a><br>
<a href="../volleyball/en-genouillere.html">Kneepads</a><br>
<a href="../volleyball/en-chevillere.html">Ankle braces</a><br>
<a href="../volleyball/en-filets.html">Nets</a><br>
<a href="../volleyball/en-accessoires.html">Accessories</a></td>
</tr>
<tr>
<td><img src="../images/espace1px.gif" width="178" height="5"></td>
</tr>
</table>
</div>
</body

推荐答案

离开代码优雅的问题......我觉得你来了这里有一个很快的解决方案,而不是JavaScript课程:


< script language =" Javascript"`>

<! -

函数Pop(名称){

document.getElementById(name).style.visibility =''vi sible'' ;

}


函数Wop(名称){

document.getElementById(name).style.visibility =''hi dden'';

}

// - >

< / script>


为什么??

因为document.all是资源管理器的专有集合,其他浏览器

不支持它。


可能会在这里看到:
http://www.dynamicdrive.com/dynamicindex1/index.html

(当然有很多类似的地方甚至更好的代码)

Leaving out the question of the code elegance... I feel you came here for a
quick-n-dirty solution and not for a JavaScript lessons:

<script language="Javascript"`>
<!--
function Pop(name){
document.getElementById(name).style.visibility=''vi sible'';
}

function Wop(name){
document.getElementById(name).style.visibility=''hi dden'';
}
//-->
</script>

WHY??
Because document.all is an Explorer''s proprietary collection, other browsers
do not support it.

LATER MAY LOOK HERE:
http://www.dynamicdrive.com/dynamicindex1/index.html
(of course there are many similar places with even better code)





" VK" < SC ********** @ yahoo.com>在留言新闻中写道:41 ********************* @ news.freenet.de ...

"VK" <sc**********@yahoo.com> wrote in message news:41*********************@news.freenet.de...
留下问题代码优雅...我觉得你来这里是为了一个快速解决方案而不是JavaScript课程:

< script language =" Javascript"`>
<! -
函数Pop(name){
document.getElementById(name).style.visibility =''vi sible'';
}

function Wop(name){
document.getElementById(name).style.visibility =''hi dden'';
}
// - >
< / script>

为什么?
因为document.all是资源管理器的专有集合,其他浏览器不支持它。

以后可以在这里查看:
http://www.dynamicdrive .com / dynamicindex1 / index.html
(当然有很多类似的地方甚至更好的代码)



Leaving out the question of the code elegance... I feel you came here for a
quick-n-dirty solution and not for a JavaScript lessons:

<script language="Javascript"`>
<!--
function Pop(name){
document.getElementById(name).style.visibility=''vi sible'';
}

function Wop(name){
document.getElementById(name).style.visibility=''hi dden'';
}
//-->
</script>

WHY??
Because document.all is an Explorer''s proprietary collection, other browsers
do not support it.

LATER MAY LOOK HERE:
http://www.dynamicdrive.com/dynamicindex1/index.html
(of course there are many similar places with even better code)






是的。 documemt.all是IE。这是对Netscape 6及以上版本的测试我相信:


ns6 =(!document.all&& document.getElementById);

/ / ns6 =如果Netscape 6+是真的

Netscape 4是这样的:


ns4 =(document.layers);

// ns4 =如果Netscape 4是真的

ie4 =(document.all&&!document.getElementById);

// ie4 = true Internet Explorer 4

ie5 =(document.all&& document.getElementById);

// ie5 = true Internat Explorer 5及以上版本


我不知道如何在这个方案中集成Firefox和Opera。


最后是的,脚本编写适用于IE。您可以考虑修复CSS。属性都是小写的。

此外,相对../images可能会更改为/ images。麻烦的是,在新的微软网站
服务器中,他们已经禁用了相对地址,而没有对新的安全性进行相对解决,因此不会再花费更长时间工作。


George Hester

__________________________________



Yes. documemt.all is IE. Here''s a test for Netscape 6 and above I believe:

ns6 = (!document.all && document.getElementById);
//ns6 = true if Netscape 6+

Netscape 4 is this:

ns4 = (document.layers);
//ns4 = true if Netscape 4

ie4 = (document.all && !document.getElementById);
// ie4 = true Internet Explorer 4

ie5 = (document.all && document.getElementById);
// ie5 = true Internat Explorer 5 and up

I''m not sure how to integrate Firefox and Opera in this scheme.

Finally yes the scripting is fine for IE. You might consider fixing the CSS. Attributes are all lower case.
Also the relative ../images may be able to change to /images. The trouble is that in new Microsoft web
servers they have disabled relative adddressing without overhauling the new security relative addressing will no
longer work.

George Hester
__________________________________


2004年10月9日星期六15:23:19 GMT,George Hester< ;他******** @ hotmail.com>

写道:


[snip]
On Sat, 09 Oct 2004 15:23:19 GMT, George Hester <he********@hotmail.com>
wrote:

[snip]
是的。 documemt.all是IE。


Opera也支持它,我相信ICEBrowser也支持它。


[snip]

ns6 = (!document.all&& document.getElementById);
// ns6 =如果Netscape 6+是真的那么
Netscape 4是这样的:

ns4 = (document.layers);
// ns4 =如果Netscape 4是真的
ie4 =(document.all&&!document.getElementById);
// ie4 =真正的Internet Explorer 4
ie5 =(document.all&& document.getElementById);
// ie5 = true Internat Explorer 5及以上


浏览器检测,无论是通过解释用户代理字符串,还是

对象推断,都存在根本缺陷。你不需要*知道你正在使用什么

浏览器,就像它能做的那样。


显然你没看过FAQ条目,4.26。

我不知道如何在这个方案中集成Firefox和Opera。


你没有。


[snip]

麻烦的是新的微软网络服务器他们已经禁用了相对地址,而没有检修新的安全设备。
寻址将不再有效。
Yes. documemt.all is IE.
Opera also supports it, and I believe ICEBrowser does, too.

[snip]
ns6 = (!document.all && document.getElementById);
//ns6 = true if Netscape 6+

Netscape 4 is this:

ns4 = (document.layers);
//ns4 = true if Netscape 4

ie4 = (document.all && !document.getElementById);
// ie4 = true Internet Explorer 4

ie5 = (document.all && document.getElementById);
// ie5 = true Internat Explorer 5 and up
Browser detection, whether by interpretation of the user agent string, or
object inference, is fundamentally flawed. You don''t *need* to know what
browser you''re using, just what it''s capable of doing.

Obviously you haven''t read FAQ entry, 4.26.
I''m not sure how to integrate Firefox and Opera in this scheme.
You don''t.

[snip]
The trouble is that in new Microsoft web servers they have disabled
relative adddressing without overhauling the new security relative
addressing will no longer work.




我很高兴我使用Apache。


迈克


-

Michael Winter

替换.invalid ;与.uk通过电子邮件回复。



I''m glad I use Apache.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


这篇关于Netscape兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆