ignore my previous email about document.anchor, i should have meant
document.hash.

something like this any use?

function addtoken(token)
{
     // get the domain + port number
     var currentURL = window.location.host;

     // get the path + file
     var currentPath = window.location.pathname;

     // find out what protocol (http, https, etc) we're using
     var currentProtocol = window.location.protocol;

     // get the #anchor
     var currentAnchor = window.location.hash;

     // add your string
     var newURL = currentProtocol + "//" + currentURL +currentPath + token
+ "#" + currentAnchor;
}

addtoken('&cfid=#cfid#&cftoken=#cftoken#');

completely untested, so no idea if it'll work for you or not, although i'd
expect it might just need minor modifications.


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


                                                                                       
                                           
                    "Robertson-Ravo, Neil (RX)"                                        
                                           
                    <[EMAIL PROTECTED]        To:     "'[EMAIL PROTECTED]'" <[EMAIL 
PROTECTED]>     
                    dexpo.com>                          cc:                            
                                           
                                                        Subject:     RE: [ cf-dev ] OT 
: Links                                    
                    01/10/2003 17:06                                                   
                                           
                    Please respond to dev                                              
                                           
                                                                                       
                                           
                                                                                       
                                           



it also doesnt remove an anchor and then re-append it!

-----Original Message-----
From: Christopher Dawes [mailto:[EMAIL PROTECTED]
Sent: 01 October 2003 15:50
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] OT : Links


Here's something I whipped up for the athletes foot (with a little mod to
include your 'javascript' and '_blank' bits. It works on Moz Firebird/IE
5+/Opera 7 - pretty much any 5+ browser should do it... as long as they
support document.all

<SCRIPT>
           function appointToken() {
                     var urltoken = "&cfid=#cfid#&cftoken=#cftoken#";
                     var anchorTags = document.all.tags("A");
                     for ( a=0; a < anchorTags.length; a++ ) {
                               if (
document.all.tags("A")[a].href.indexOf("mailto:";) == -1
                                          &&
document.all.tags("A")[a].href.indexOf("javascript:") == -1
                                          && document.all.tags
("A")[a].target !=
"_blank" )
                                          {
                                                    document.all.tags
("A")[a].href =
document.all.tags("A")[a].href + urltoken;
                                                    }
                                          }
                     }

           appointToken();
</SCRIPT>


Kind Regards,
Christopher Dawes
Dawes International
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, 2 October 2003 12:06 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] OT : Links

:-)

-----Original Message-----
From: Rich Wild [mailto:[EMAIL PROTECTED]
Sent: 01 October 2003 15:08
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] OT : Links


lol. that JS looks familiar to me!

> -----Original Message-----
> From: Robertson-Ravo, Neil (RX)
> [mailto:[EMAIL PROTECTED]
> Sent: 01 October 2003 14:59
> To: '[EMAIL PROTECTED]'
> Subject: [ cf-dev ] OT : Links
>
>
> I have a block of JS which appends CFID/CFTOKEN to any link
> in a page, however, if one of those links as an anchor in it,
> it simply ignores the link and doesnt append the cfid/cftoken....
>
> What I need it to is, append the cfif/cftoken AND the anchor
> reference, but with the anchor reference at the end of the string!
>
> anyone?
>
>
>          <script language="Javascript">
>
>                              function setLinks() {
>                                       var thisLink = "";
>                                       var urltoken =
> "&cfid=#cfid#&cftoken=#cftoken#";
>
>                 for (var i=0; i<document.links.length; i++) {
>                 thisLink = document.links[i];
>                                         //if
> ((thisLink.href.indexOf('mailto:') ==
> -1) && (thisLink.href.indexOf('javascript:') == -1) &&
> (thisLink.target.toLowerCase() != '_blank')) {
>                                         if
> ((thisLink.href.toLowerCase().indexOf('appname') > -1) &&
> (thisLink.href.toLowerCase().indexOf('javascript:') == -1) &&
> (thisLink.href.toLowerCase().indexOf('##') == -1)) {
>                          //if
> (thisLink.href.indexOf('homepage.cfm') != -1) {
>                                  thisLink.href += urltoken;
>                                //}
>                  }
>                     }
>
>                    }
>                    </script>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED] For human help, e-mail:
> [EMAIL PROTECTED]
>


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]






-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to