...

View Full Version : function call when onClick on image occurs



blommethomas
01-24-2007, 04:57 PM
Hello, what I'm trying to achieve is that when an image is clicked: it redirects to a webpage. I do not wan't it to just redirect however, some values should be given(window size, referrer, browser version and so on) before the other webpage is requested. I'll do this with a javascript function that appends some values(like a GET method) to the link:

<SCRIPT language="javascript">

function createAppendedString(link)
{
//perform some actions and create a link
}
function redirect(link)
{
//calls createAppendedString with link as argument
window.location=link;
</SCRIPT>


This code is called fro mthe following image:
<IMG src='source' align='middle' onclick="this.redirect('main.php')"></IMG>


why doesn't it work, if I click on the image it displays that an error occured

TripperTreats
01-24-2007, 07:03 PM
onclick="redirect('main.php')"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum