Thanks :) :)
Just out of interest is there anyway to disable all links and active a
specific one?
Thanks again
"Lasse Reichstein Nielsen" <lrn@hotpop.com> wrote in message
news:vfu3xknb.fsf@hotpop.com...[color=blue]
> "chris hughes" <chris(remove)_hughes4@hotmail.com> writes:
>[color=green]
> > Can anyone please tell me how to create a javascript that I can place in[/color][/color]
any[color=blue][color=green]
> > page that will disable all the links or just change all the hrefs to #[/color]
>
> disable links by removing the a-element:
> ---
> function disableLinks () {
> for (var i=0;i < document.links.length;i++) {
> var link = document.links[i];
> for (var j=0;j<link.childNodes.length;j++) {
> link.parentNode.insertBefore(link.firstChild,link) ;
> }
> link.parentNode.removeChild(link);
> }
> }
> document.body.onload=disableLinks;
> ---
>
>
> Disable links by adding javascript clickhandler:
> ---
> function retFalse () {
> return false;
> }
> function disableLinks () {
> for (var i=0;i < document.links.length;i++) {
> document.links[i].onclick = retFalse;
> }
> }
> document.body.onload=disableLinks;
> ---
> (the disabling only works with javascript on, but so does this
> script to begin with)
>
> Change all hrefs to "" (shorter than "#"):
> ---
> function disableLinks () {
> for (var i=0;i < document.links.length;i++) {
> document.links[i].href = "";
> }
> }
> document.body.onload=disableLinks;
> ---
>
> Good luck with whatever you are up to.
> /L
> --
> Lasse Reichstein Nielsen -
lrn@hotpop.com
> Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
> 'Faith without judgement merely degrades the spirit divine.'[/color]