Execute javascript from link

Posted by GigaPr on Stack Overflow See other posts from Stack Overflow or by GigaPr
Published on 2010-04-13T19:54:01Z Indexed on 2010/04/13 20:03 UTC
Read the original article Hit count: 358

Filed under:
|
|

Hi,

i am just trying to create a link which execute some JavaScript in stead to redirect the user to a particular page

I tried the following but it doesn t work

<a href="#" onclick="javascript:location.replace('http://http://stackoverflow.com/questions/ask');">www.google.com</a><br />


<a href="javascript:location.replace('http://stackoverflow.com/questions/ask');">www.google.com</a>

I am not trying to do anything illegal whit the redirect, just an exercise for a university module (Internet Security)

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html