View Full Version : Link manipulating?

02-12-2007, 04:00 PM
Hi there,

just one short question for a JS newbie:

I want to manipulate a normal href link with the onClick event.
<a href="http://anywhere.com" onClick="action()">Link</a>

The browser request should look like:

In short: I want to attach a string (http://mypage.com/check.php?url=) to the url. But it's manadatory that the href tag (href="http://anywhere.com") stays! Is this even possible? I don't think so!?

Any help or tips are appreciated! THANK YOU! :)

02-12-2007, 04:22 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" >
function action(me)
<a href="http://anywhere.com" onClick="action(this);">Link</a>

02-12-2007, 10:20 PM
Great! Thank you! :thumbsup: