How To Redirect After Someone "Likes" your website

Discussion in 'FaceBook' started by agent01, Jul 6, 2010.

  1. agent01

    agent01 BANNED BANNED

    Joined:
    Apr 15, 2010
    Messages:
    124
    Likes Received:
    48
    How do you redirect someone to another page after they "like" your website page?
     
  2. dannygoodman

    dannygoodman BANNED BANNED

    Joined:
    Aug 24, 2009
    Messages:
    76
    Likes Received:
    5
    if you're talking about the facebook like button then you can't because they are clicking an iframe of facebook so they are clicking inside a new DOM
     
  3. agent01

    agent01 BANNED BANNED

    Joined:
    Apr 15, 2010
    Messages:
    124
    Likes Received:
    48
    ive seen it redirected on 25 different "like" pages...it is possible
     
  4. ShOwA

    ShOwA Regular Member

    Joined:
    Feb 7, 2010
    Messages:
    299
    Likes Received:
    69
    Bump me a PM, I'll take a look
     
  5. voyevoda

    voyevoda Regular Member Premium Member

    Joined:
    Mar 21, 2010
    Messages:
    217
    Likes Received:
    97
    Location:
    Eastern Front
    Use setInterval() to poll to see what the active element is every 50-100ms. If the active element is the Facebook Like button, use setTimeout() to schedule some more Javascript to run in 50ms (like document.location = "whatever").

    You may want to delay for more like 1-2 seconds to give time for the Like request to finish being processed on Facebook's end.
     
  6. ogeee

    ogeee Registered Member

    Joined:
    Mar 28, 2010
    Messages:
    86
    Likes Received:
    18
    Location:
    UK
    I'm not great at javascript or web dev in general but it's incredibly easy to run some code when someone clicks the like button. You might do a bit of the old document.location = "whatever" or whatever you like when they click like.

    It's not exactly what you're looking for but I personally use it to show content when they click like at the same time as hiding the like button so they don't unlike it... I just make one div visible and one hidden when they click like.
     
    Last edited: Jul 6, 2010