Forum Moderators: open

Message Too Old, No Replies

How To Perform Two Functions With A Link

         

murmy

4:53 pm on Feb 10, 2009 (gmt 0)

10+ Year Member


I wanted to find out how to perform two functions with a basic html link. So for example, you click the link and it brings up the download dialogue for a program (so the user can download the program) whilst simultaneously moving the index page to a download page.

This method is employed on a lot of poker & gaming sites.

I have tried googling this but to no avail... any help would be greatly appreciated.

daveVk

11:32 am on Feb 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This method is employed on a lot of poker & gaming sites.

Why not look and see, find the link in question on one of these sites within the page source. One of the links is probably the href=, while the other a windows.open in the onclick handler, but could be some other trick, iframe.src ? or ajax ?

Lang

5:22 am on Feb 12, 2009 (gmt 0)

10+ Year Member



function foo(){ alert('foo'); bar(); }
function bar(){ alert('bar'); }

<a href="Javascript:foo();">Click here</a>

This is one way you could achieve it.

Or simply <a href="Javascript:foo();bar();">Click here</a>