<a href="[...]" onclick="return DoOnClick(this) "> page title </a>
[...]
function DoOnClick(oLink ) {
var query = "foo=bar&baz=42 "; // change this to your needs
oLink.href += "?" + query;
return true;
}
See <news:39******* ******@individu al.net> for some explanation.
Probably this solves your described problem, too; I didn't test
your code, since I assume it will work with the above changes.
ciao ,dhgm
- no - it doesn't solve it. --- same thing happens.
When I following on the links on the site, the get recorded
in the browser history with the query parts attached.
(But when I follow them on the local mirror, they're recorded
without the query.)
This is good though, --thanks!,
I wouldn't have learned about it otherwise,
and it it saves space,
( although i don't understand it - --especially why "return true" part
(--- i also tried "return false, -- and it doesn't work)..
Well, -- Here's one of the index pages:
http://lcngarc.twoshakesofalambstail...9.html?0000012
(- and that's good
- i got it with an example query on it --
(--- hmmm, -- Maybe that's it, -- that the query's are like that,
-- not like "?a=b" ,. .the browser might not recognize it as a query on the url?? ...)
Here's an example of a link on the index page:
3 <a name='n3' class='clA' id='id3' href='1994/09/1994090075.html ' onclick="return Nav(this)">Welc ome! `<i>Perry E.
Metzger</i>`</a>
And the relevant JavaScript follows.
~greg
---------------------------------------------
var state = '';
function Nav( addr )
{
addr.href += state;
return true;
}
function RealTop(el)
{
var y = el.offsetTop;
var el2 = el.offsetParent ;
while (el2 != null)
{
y += el2.offsetTop;
el2 = el2.offsetParen t;
}
return y;
}
function DoOnLoad()
{
state = location.search .substring(0,6) ;
var target = location.search .substring(6);
if(target != '')
{
var el = document.getEle mentById( 'id' + target);
el.style.color = "#FF0000";
el.style.backgr ound = "#FFFFFF";
el.style.textDe coration = "line-through";
var h = 200; // wild guess for the default
var h1 = document.body.c lientHeight; // NN n/a IE ok
var h2 = window.innerHei ght; // NN 4 IE n/a
if ( (h1 != null) && (h1 != 0)) h = h1;
else if ( (h2 != null) && (h2 != 0)) h = h2;
h = Math.floor(h/2);
var y = null;
if( el.offsetTop){y = RealTop(el)}
else if (el.y) {y = el.y}
if ( y != null ) { scrollBy(0, y - h)}
else{location.h ref = '#n' + target }
}
}