1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript Code To Call Facebook Add Friend OnClick Function

Discussion in 'HTML & JavaScript' started by back2black, Mar 6, 2010.

  1. back2black

    back2black Junior Member

    Joined:
    Dec 20, 2008
    Messages:
    116
    Likes Received:
    28
    Hi All,

    I am trying to make a page automatically click a button... basically here is the link:

    HTML:
    <a href="#" class="actionspro_a" onclick="return SocialGraphViewActionHandler.onAddFriend({"obj_label":"Page","source":"people_browser_full","node_id":46873245194,"element":"pb_46873245194","action":"add_friend","title":"Eric Gaines","id":1465857131})">Add as Friend</a>
    So there is no href, but there is an onclick bit.

    Does anyone know how I would call this onclick function automatically?

    Cheers all
     
  2. Aliks

    Aliks Newbie

    Joined:
    Feb 22, 2009
    Messages:
    11
    Likes Received:
    1
    Maybe you should try to use "onload" instead of onclick
     
  3. back2black

    back2black Junior Member

    Joined:
    Dec 20, 2008
    Messages:
    116
    Likes Received:
    28
    thanks for your reply - but that code above is code already in the facebook site.... so thats actually in the HTML. (I cant change it to onload)

    So what I want to do is simulate clicking the button... i.e. i want to invoke to onclick part.
     
  4. showboytridin

    showboytridin Regular Member

    Joined:
    Sep 5, 2009
    Messages:
    348
    Likes Received:
    716
    Location:
    127.0.0.1
    That's only possible if you use the javascript code on the facebook page. You can't use from other page.
    Posted via Mobile Device