Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    function call when onClick on image occurs

    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

  • #2
    New Coder TripperTreats's Avatar
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    onclick="redirect('main.php')"
    Psychedelic digital art at www.trippertreats.com.

    "And in the end, the love you take
    is equal to the love you make
    ."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •