Suppose I have a myFile.html file containing a link
<a href="myFile.html#myAnchor"> Go to anchor! </a>
which points to an anchor in the same file:
<a name="myAnchor"> I knew you would come here! </a>
When I load the file in the TextMate HTML window, apparently, the link to the anchor does not work (when I click on it, the HTML page goes blank). What am I doing wrong?
Thanks, Piero
On 29/9/2006, at 20:08, Piero D'Ancona wrote:
Suppose I have a myFile.html file containing a link
<a href="myFile.html#myAnchor"> Go to anchor! </a>
which points to an anchor in the same file:
<a name="myAnchor"> I knew you would come here! </a>
When I load the file in the TextMate HTML window, apparently, the link to the anchor does not work (when I click on it, the HTML page goes blank). What am I doing wrong?
It works for me -- what does the base URL show (in the rounded text control at the top of the window)?
It works for me -- what does the base URL show (in the rounded text control at the top of the window)?
Not sure what you mean by "rounded text control" -- the title bar at the top of the HTML window shows the name I have given to the command, in this case it is "prova"
Let me reiterate: I create a command "prova", input=none, output=show as html. The text of the command is
cat ~/Desktop/myFile.html
The file myFile.html contains the following:
<html><body> <a href="myFile.html#myAnchor"> Go to anchor! </a> text ... (omitted text) ... text text <a name="myAnchor"> I knew you would come here! </a> </body></html>
I run the command, the HTML window appears (with "prova" in the title bar). I click on the link, the window goes blank.
Thank you for any help, Piero
On 9/30/06, Piero D'Ancona pierodancona@gmail.com wrote:
Let me reiterate: I create a command "prova", input=none, output=show as html. The text of the command is
cat ~/Desktop/myFile.html
The file myFile.html contains the following:
<html><body> <a href="myFile.html#myAnchor"> Go to anchor! </a>
The HTML window is showing the output of the 'cat' command, and is *not* reading the file itself: hence it doesn't know any filename for the html.
Your link, however, is specifically referencing a file "myFile.html" which the HTML window will look for in its working directory (whatever that may be).
To get it to work, change your link to be relative to the current document, i.e. href="#myAnchor".
Andrew
Andrew Durdin <adurdin@...> writes:
Your link, however, is specifically referencing a file "myFile.html" which the HTML window will look for in its working directory (whatever that may be). To get it to work, change your link to be relative to the current document, i.e. href="#myAnchor".
Right. Now it works, and I feel stupid.
Thanks! Piero