It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes 'a href' in firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark " Watch " New topic
Author

'a href' in firefox

Maggie Taylor
Greenhorn

Joined: Feb 14, 2006
Posts: 10
Hi,

I'm using this code..




I have a few people names in alphabetical order list from A to Z. When I click on an alphabet I expect it to go firstname starting with that alphabet.

I have defined <a name ="A">A</a> <a name="B">B</a> , etc. (all the alphabets) appropriately for the names starting with that alphabet on the html page.

This is working perfectly fine in Internet Explorer, but not in Firefox. What might be the problem ?

thanks
[ April 06, 2006: Message edited by: Maggie Taylor ]
Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
You will need to put an anchor tag <a> around the letter(s) to which you want to go. For examle:


<a href="#W">W</a>
...
...
<a name="W">W</a>

The first anchor tag is what you click on to get to the second anchor tag.


<a href="http://labryssystems.net/pblog/index.php" target="_blank" rel="nofollow">Javaville Gazette</a><br />Non-cooperation with evil is a duty. -- Mahatma Gandhi
Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
Oops, I only got part of that in....

I tried this this with Firefox 1.5 and it works fine.
Here is a snippet of the HTML:


<html>
<body>
<a href="#W">go to W</a>
<br />
....
....

<a name="W">W</a>
...
...
Maggie Taylor
Greenhorn

Joined: Feb 14, 2006
Posts: 10
thanks for helping...but it's still not working i'm using Mozilla 1.5 as well.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
try

<a name="W" id="W">W</a>

or

<a name="W" id="W"></a>W

or even

<a name="W" id="W" href="#W">W</a>

One of those will hopefully work. To busy to test.

Eric
Linda Walters
Ranch Hand

Joined: Apr 30, 2005
Posts: 100
Maggie,

The following HTML works in IE 6.0, Firefox 1.5.01, Mozilla 1.7.12, Netscape 8.0.3.3 and even in Opera 8.5. Note that all of the <br /> tag are here to make the page long enough to acutally see it goto the letter.

<html>
<body>
<a href="#W">Go To W</a><br /><br />
<a name="A">A</a>
<br /><br /><br /><br />
<a name="B">B</a>
<br /><br /><br /><br />
<a name="C">C</a>
<br /><br /><br /><br />
<a name="D">D</a>
<br /><br /><br /><br />
<a name="E">E</a>
<br /><br /><br /><br />
<a name="F">F</a>
<br /><br /><br /><br />
<a name="G">G</a>
<br /><br /><br /><br />
<a name="H">H</a>
<br /><br /><br /><br />
<a name="I">I</a>
<br /><br /><br /><br />
<a name="J">J</a>
<br /><br /><br /><br />
<a name="K">K</a>
<br /><br /><br /><br />
<a name="L">L</a>
<br /><br /><br /><br />
<a name="M">M</a>
<br /><br /><br /><br />
<a name="N">N</a>
<br /><br /><br /><br />
<a name="O">O</a>
<br /><br /><br /><br />
<a name="P">P</a>
<br /><br /><br /><br />
<a name="Q">Q</a>
<br /><br /><br /><br />
<a name="R">R</a>
<br /><br /><br /><br />
<a name="S">S</a>
<br /><br /><br /><br />
<a name="T">T</a>
<br /><br /><br /><br />
<a name="U">U</a>
<br /><br /><br /><br />
<a name="V">V</a>
<br /><br /><br /><br />
<a name="W">W</a>
<br /><br /><br /><br />
<a name="X">X</a>
<br /><br /><br /><br />
<a name="Y">Y</a>
<br /><br /><br /><br />
<a name="Z">Z</a>
</body>
</html>
Maggie Taylor
Greenhorn

Joined: Feb 14, 2006
Posts: 10
thanks once again. I got it working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 'a href' in firefox
 
Similar Threads
Math.Random() query
Dsplaying the alphabet with a loop?
JSP page strange Output
HELP~~
for loop demo