1

I am using Microsoft Internet Explorer version 8 on Windows 7. I have a HTML document that contains fragment IDs. When I open Internet Explorer and enter the URL for my HTML page and include a fragment ID in the entered URL, the page is displayed but not at the requested part. Below is the first part of my HTML document. Note that the document is very large and contains many fragment IDs. What is listed below is just a small part of my document.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="rtl" lang="iw">
<head>
<meta http-equiv="Content-Type" content="text/html">
</head>
<body>
<!-- Lots of lines of text -->
<h2 id="George%20Best">George Best</h2>

I use the following URL:

file:///C:/HTML/MyPage.html#George%20Best

The page is displayed somewhere in the middle of the document, but nowhere near the heading "George Best".

Note that if I enter the following URL, the page is displayed at the top:

file:///C:/HTML/MyPage.html

Then if I manually append the fragment ID to the end of the URL, the display readjusts and the correct section of the document is displayed. I believe I am missing something but I don't know what. I am hoping that someone reading this will be able to enlighten me.

Thank you.

Abra
  • 19,142
  • 7
  • 29
  • 41

1 Answers1

0

You're trying to call the fragment ID but you're not url encoding the reference. Try this instead.

file:///C:/HTML/MyPage.html#George%2520Best

%25 is the url encoding for the % sign.

AbsoluteƵERØ
  • 7,816
  • 2
  • 24
  • 35