Help with OnClick Function

Discussion in 'JavaScript' started by ShaunG, Mar 30, 2009.

  1. #1
    I am not familiar with JS at all, but I wanted to know if this was possible to do using onClick. I have 2 links on my page to 2 other pages. When these links are clicked, I want to record the subid that is in the URL under subid=

    I need one to go to offer1.txt and the other one to record to offer2.txt. Someone told me this may work so I can record the clicks for each offer as my tracking software only records the first click. Any insights or help with this code would be much appreciated!
     
    ShaunG, Mar 30, 2009 IP
  2. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What you need to do is execute a script on your page before you redirect the user. It can be done either with AJAX - you update the counter on your site and when it's done redirect the user to the linked site. The other way is to change the link to point to another script on your page. This script will first update the clicks counter and then redirect the user to the right page.
     
    xlcho, Mar 30, 2009 IP
  3. ShaunG

    ShaunG Peon

    Messages:
    267
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3

    Do you have anything similar to what you describe on your site? As I said, I am not very familiar with js. I took a look around but could not find anything. If anyone else code code up the js to do what is mentioned above quickly, I would really appreciate it. thanks for the input!
     
    ShaunG, Mar 31, 2009 IP
  4. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I haven't written a tutorial for this, cause I don't use it.. Anyway, maybe i will, but i don't have the time right now :(
     
    xlcho, Apr 1, 2009 IP
  5. ShaunG

    ShaunG Peon

    Messages:
    267
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If anyone can help me with this, I would be willing to pay you. Please PM me if you are interested, thanks.
     
    ShaunG, Apr 1, 2009 IP