That should be fine, according to browser tests I did a while ago:
In this case, if Jacquie is a location on the same page the href attribute should be #jacquie and if it's on another page called staff it should be staff#jacquie, and should work regardless whether you're using a named anchor or id'd element.
If you're using ID's and want to be absolutely sure it works you can always put this type of script at the bottom of the linked page:
Quote:Apparently Mozilla Firefox doesn't associate the id attribute with a location in the HTML Document for elements other than<a>
but uses the name attribute instead, and Google Chrome does exactly the opposite. The most cross-browser proof solution would be to either:
1.Give your anchor divs both a name and an id to ensure max. browser compatibility, like:
<a href="#map">Go to Map</a> <!-- Link -->
----
<div id="map" name="map"></div> <!-- actual anchor -->
Demo: http://jsbin.com/feqeh/3/edit
2.Only use <a> tags with the name attribute as anchors.
In this case, if Jacquie is a location on the same page the href attribute should be #jacquie and if it's on another page called staff it should be staff#jacquie, and should work regardless whether you're using a named anchor or id'd element.
If you're using ID's and want to be absolutely sure it works you can always put this type of script at the bottom of the linked page:
Code:
<script>
var loc = location.href;
if (loc.match('#')) && document.getElementById(loc.split('#')[1]))
document.getElementById(loc.split('#')[1]).scrollIntoView();
</script>