This code will do it for you.  You can obviously change the function
definition to whatever you need.

  for(i=0;i<document.links.length;++i) {
    if (document.links[i].href.indexOf("fuseaction=LogOff") >= 0) {
      document.links[i]. {
       return confirm("are you sure you want to log off?");
      }
    }
  }

Cheers,
barneyb

> -----Original Message-----
> From: Casey C Cook [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 21, 2004 10:55 AM
> To: CF-Talk
> Subject: RE: Javacript Onclick Question - Getting Closer
>
> I found some code that identifies the links in my document.
>
> function describeLinks(){
>  outputWindow.document.write("<H3>Links</H3>")
>  outputWindow.document.write("This document contains
> "+document.links.length+" links:<BR>")
>  for(i=0;i<document.links.length;++i)
>   outputWindow.document.write(document.links[i].href+"<BR>")
>
> Using this code identified the following link:
> http://myserver:myport/test/index.cfm?fuseaction=LogOff
>
> Now, how might I write the code to for the following logic.
>
> If you find the link text "fuseaction=LogOff"  then onclick
> "pop up a confirmation window".
>
> Looks like were headed down the right path.
>
> Thanks!
> Casey Cook
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to