본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Handling of Relative Attributes in Href

  • 4 답장
  • 2 이 문제를 만남
  • 5 보기
  • 최종 답변자: wychegnome

more options

http://www.w3schools.com/tags/att_a_href.asp defines the attributes for urls that can be used with the href declaration in an anchor tag.

I have been using a relative attribute as set out in that definition within a web site in the form "<a href="ref-mt.html#006">MT006</a>" where the html file called is in the same directory on the web site as the page containing the call.

IE and Safari expand this call correctly to "http://www.s-r-s.org.uk/railref/ref-mt.html#006" and the link works as intended. Firefox does so as well when I use my local copy to test before uploading to the web site, BUT Firefox fails to expand correctly when working from the live web site. In these circumstances it expands the call to "http://www.s-r-s.org.uk/ref-mt.html#006" which does not work (page not found error) because the file is not in the root directory of the web site.

Interestingly if I alter the HTML code to <a href="../railref/ref-mt.html#006">MT006</a> Firefox does work correctly and, once that call is made it correctly expands all the other similar calls which remain in the form "<a href="ref-mt.html#006">MT006</a>".

Why does the expansion fail in this way?

http://www.w3schools.com/tags/att_a_href.asp defines the attributes for urls that can be used with the href declaration in an anchor tag. I have been using a relative attribute as set out in that definition within a web site in the form "<a href="ref-mt.html#006">MT006</a>" where the html file called is in the same directory on the web site as the page containing the call. IE and Safari expand this call correctly to "http://www.s-r-s.org.uk/railref/ref-mt.html#006" and the link works as intended. Firefox does so as well when I use my local copy to test before uploading to the web site, BUT Firefox fails to expand correctly when working from the live web site. In these circumstances it expands the call to "http://www.s-r-s.org.uk/ref-mt.html#006" which does not work (page not found error) because the file is not in the root directory of the web site. Interestingly if I alter the HTML code to <a href="../railref/ref-mt.html#006">MT006</a> Firefox does work correctly and, once that call is made it correctly expands all the other similar calls which remain in the form "<a href="ref-mt.html#006">MT006</a>". Why does the expansion fail in this way?

모든 댓글 (4)

more options

No problems here.

Reload web page(s) and bypass the cache.

  • Press and hold Shift and left-click the Reload button.
  • Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
  • Press "Cmd + Shift + R" (MAC)
more options

Thank you for responding cor-el.

I have since spotted some typos in my page railref.html and changing the \ to / in the railref.html page has resolved the matter - but still doesn't explain why Firefox didn't cope. IE and Safari didn't fall over on this and correctly expanded the links despite use of \ for / on the railref page.

more options

Firefox does not cope because it is not allowed according to webstandards. IE does not think that this is an error because backslashes are normal delimiters on the Windows platform, so they have a workaround for this.

more options

Thank you for the response.

It does seem that Safari also provides a 'work round'. I'm not sure they would have the same excuse as Microsoft though.