Slash Boxes  All the Perl that's Practical to Extract and Report
use Perl Log In  Log In  [ Create a new account ]  Journal of
LTjake (4001)  Thursday March 20, 2003 12:39 PM  base + named
hrefs  [ #11131 ]  Well, since my journal is already a bitch
fest... :)  I've been constructing a site. I decided to use the
<base href="..."> to _try_ simplify things in my documents. This
is fine and dandy, except for named hrefs (i.e. links to items
like #top).  When using base, named hrefs will only point to
named refs on the base page. I decided to try and solve things
with javascript. Here's what i came up with:   function
namedRef(strLink, strText) {     var intPosition =
document.location.href.indexOf("#");      if (intPosition < 0) {
        intPosition = document.location.href.length;      return
"<a href=\"" + document.location.href.substring(0, intPosition)
+ "#" + strLink + "\">" + strText + "<" + "/a>";  somewhere in
the html file:  <script type="text/javascript">
document.write(namedRef('top', 'Top'));  This