我的Javascript中的错误或Firefox中的错误 [英] Bug in my Javascript or bug in Firefox

查看:75
本文介绍了我的Javascript中的错误或Firefox中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我决定尝试使用Firefox。我遇到过这样的行为,无论是Firefox中的错误还是我的Javascript代码中的错误。我会尝试解释这个问题,希望这个新闻组可以(在)中验证我的Javascript代码。


首先,我会描述Javascript代码的目的。


我经常需要在我自己的网站上发布一些URL,例如,
http://www.standards.com/Sorting/Sor...scription.html

每个URL都不容易记住,或者输入没有错误,所以我决定用
写我的第一个Javascript就可以使用了
http://www.standards.com/index.html?Sorting ,最终将进入 http:// www。 standards.com/Sorting/Sor...scription.html


然后我决定,perh aps没有充分理由,也允许
http:// www .standards.com / index.html#Sorting 意思相同
http://www.standards.com/index.html?Sorting 。当然,只有在启用了Javascript的情况下才有效。为那些没有启用Javascript的人提供,

例如, http://www.standards.com/index.html#Sorting 将转到一个锚点,

链接到非Javascript链接列表。


所有似乎都使用IE很好,但大约35小时前,我冲动地安装了Firefox 1.0的b $ b。


Firefox似乎有如果Javascript解决了问题,例如,
http:// www .standards.com / index.html#XXX 实际上是
http://www.standards.com/index.html#XXX ,而IE没有问题。对于

示例,使用IE和Firefox以及
中的链接 http://www.standards.com/test-links-global.html


这是一个Firefox错误吗?

或者我在Javascript中做错了什么 http://www.standards.com/links-index.js 。

如果是后者,如何通过客户端更正Javascript

解决方案?

-
http://www.standards.com/; 请参阅Howard Kaikow的网站。

Yesterday, I decided to try Firefox. I''ve encountered a behavior that is
either a bug in Firefox or a bug in my Javascript code. I''ll try to explain
the problem, hoping that this newsgroup can (in)validate my Javascript code.

First, I''ll describe the purpose of the Javascript code.

I often have a need to post a URL to something at my own web site, e.g.,
http://www.standards.com/Sorting/Sor...scription.html.
It is not easy to remember, or type without error, each URL, so I decided to
write my first Javascript to be able to use
http://www.standards.com/index.html?Sorting instead, which ends up going to
http://www.standards.com/Sorting/Sor...scription.html.

I then decided, perhaps for no good reason, to also allow
http://www.standards.com/index.html#Sorting to mean the same as
http://www.standards.com/index.html?Sorting. Of course, this works only if
Javascript is enabled. To provide for those not having Javascript enabled,
e.g., http://www.standards.com/index.html#Sorting will go to an anchor that
links to a list of non-Javascript links.

All seemed to work well using IE, but about 35 hours ago, I impulsively
installed Firefox 1.0.

Firefox seems to have a problem if the Javascript resolves, e.g.,
http://www.standards.com/index.html#XXX to actually be
http://www.standards.com/index.html#XXX, whilst IE has no problems. For
example, use IE and Firefox with the links in
http://www.standards.com/test-links-global.html.

Is this a Firefox bug?
Or am I doing something wrong in the Javascript in
http://www.standards.com/links-index.js.
If the latter, how can the Javascript be corrected with a client side
solution?
--
http://www.standards.com/; See Howard Kaikow''s web site.

推荐答案

Howard Kaikow写道:

[snip]
Howard Kaikow wrote:
[snip]
http://www.standards.com/index.html#Sorting
http://www.standards.com/index.html?




也许吧?
http://www.standards.com/index.html#Sorting?Sorting

重命名您的锚点排序?排序

请务必解析#Sorted"对于你的js浏览器,

Mick



Perhaps?
http://www.standards.com/index.html#Sorting?Sorting
Rename your anchor "Sorting?Sorting"
Be sure to parse out "#Sorting" for your js browsers,
Mick


Howard Kaikow说:
Howard Kaikow said:

昨天,我决定尝试Firefox。我遇到的行为既可能是Firefox中的错误,也可能是我的Javascript代码中的错误。

Yesterday, I decided to try Firefox. I''ve encountered a behavior that is
either a bug in Firefox or a bug in my Javascript code.




如果你给Firefox一个没有的URL不存在,它会抱怨

并拒绝加载它。这对我来说似乎不合理。


IE显然会默默地加载错误的地址(页面顶部

,忽略了锚点规范)。


我不认为这是Firefox或你的代码中的错误。


问题sems到因为你的设计依赖于一个不被Firefox共享的IE浏览器





If you give Firefox an URL that doesn''t exist, it will complain
and refuse the load it. That doesn''t seem unreasonable, to me.

IE, apparently, will silently load the wrong address (the top of
the page, ignoring the anchor specification).

I don''t see that as either a bug in Firefox or in your code.

The problem sems to be that your design relies upon a quirk of IE
that is not shared by Firefox.


" Lee" < RE ************** @ cox.net>在消息中写道

news:co ********* @ drn.newsguy.com ...
"Lee" <RE**************@cox.net> wrote in message
news:co*********@drn.newsguy.com...
如果你给Firefox一个没有的网址它存在,它会抱怨并拒绝它的负载。对我来说,这似乎并不合理。


是的,但是导致问题的URL确实存在,即锚点在

index.html文件中。
$ b显然,$ b IE会默默地加载错误的地址(页面顶部,忽略锚点规范)。

我不认为这是Firefox中的一个错误或者在你的代码中。

问题是你的设计依赖于一个不被Firefox共享的IE的怪癖。
If you give Firefox an URL that doesn''t exist, it will complain
and refuse the load it. That doesn''t seem unreasonable, to me.
Yes, but the URL that is causing problems does exist, i.e., the anchor is in
the index.html file.
IE, apparently, will silently load the wrong address (the top of
the page, ignoring the anchor specification).

I don''t see that as either a bug in Firefox or in your code.

The problem sems to be that your design relies upon a quirk of IE
that is not shared by Firefox.



如果我不能依赖比尔盖茨,我可以依靠谁?


If I cannot rely on Bill Gates, who can I rely on?


这篇关于我的Javascript中的错误或Firefox中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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