View Full Version : Problem passing variable to anchor on page

02-26-2003, 06:05 PM
I'm trying to pass a variable to a page. My code is as follows:

To link to a new page:
<a href="../gloss.htm" onClick="intercept(this)">Text</a>

Which calls the function:
function intercept(what) {
what.href += '?db=' + db; //adds the correct db scenario (?db=...) to the end of the URL

Essentially what happens is, the link becomes

However, when I do this with a link to an anchor, it doesn't work.
I've put in alert boxes to show me the values, and they claim that the path is correct:
but when it loads into the page it turns to
and of course it doesn't go to the correct location on the page.

Is this a limitation of the browsers? Is there a way around it?