Closed Thread
Results 1 to 6 of 6

Thread: How To Click An OnClick Button Without Clicking Page?

  1. #1
    tradingjamie is offline Learning Programmer
    Join Date
    Mar 2009
    Posts
    37
    Rep Power
    0

    How To Click An OnClick Button Without Clicking Page?

    Hi All,

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

    HTML Code:
    <a href="#" class="actionspro_a" onclick="return SocialGraphViewActionHandler.onAddFriend({&quot;obj_label&quot;:&quot;Page&quot;,&quot;source&quot;:&quot;people_browser_full&quot;,&quot;node_id&quot;:46873245194,&quot;element&quot;:&quot;pb_46873245194&quot;,&quot;action&quot;:&quot;add_friend&quot;,&quot;title&quot;:&quot;Eric Gaines&quot;,&quot;id&quot;: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. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,494
    Blog Entries
    75
    Rep Power
    143

    Re: How To Click An OnClick Button Without Clicking Page?

    Code:
    <script type="text/javascript">>
    SocialGraphViewActionHandler.onAddFriend({&quot;obj_label&quot;:&quot;Page&quot;,&quot;source&quot;:&quot;people_browser_full&quot;,&quot;node_id&quot;:46873245194,&quot;element&quot;:&quot;pb_46873245194&quot;,&quot;action&quot;:&quot;add_friend&quot;,&quot;title&quot;:&quot;Eric Gaines&quot;,&quot;id&quot;:1465857131})
    </script>
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    tradingjamie is offline Learning Programmer
    Join Date
    Mar 2009
    Posts
    37
    Rep Power
    0

    Re: How To Click An OnClick Button Without Clicking Page?

    thanks WingedPanther...

    I tried that code before actually, I put it just before the </body> tag, but nothing happens.

    Basically Im trying to make a script to add my friends in facebook automatically, and that script code is the code that runs when you click "Add as friend".

    Nothing seems to happen when I run this. I do login to my account before running that code just in case that was something to do with it.

    Any ideas?

  5. #4
    Join Date
    Jul 2006
    Posts
    16,494
    Blog Entries
    75
    Rep Power
    143

    Re: How To Click An OnClick Button Without Clicking Page?

    You're assuming there are no other controls in place to prevent you auto-friending yourself.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    tradingjamie is offline Learning Programmer
    Join Date
    Mar 2009
    Posts
    37
    Rep Power
    0

    Re: How To Click An OnClick Button Without Clicking Page?

    Well... put it this way, its definitely possible, because other people have written applications to do it already

  7. #6
    DarkLordoftheMonkeys's Avatar
    DarkLordoftheMonkeys is offline Programming Professional
    Join Date
    Oct 2009
    Location
    Massachussets
    Posts
    255
    Blog Entries
    56
    Rep Power
    11

    Re: How To Click An OnClick Button Without Clicking Page?

    Why not just make a script that runs the code unconditionally, without bothering with the onclick? To tell Javascript to wait for the user to click on something to do what you want it to do automatically just seems to defeat its own purpose.
    Life's too short to be cool. Be a nerd.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Simulate a button click?
    By bluemasterflows in forum Java Help
    Replies: 1
    Last Post: 12-23-2010, 02:45 PM
  2. Help Click a Button on a web page?
    By lobfredd in forum Visual Basic Programming
    Replies: 2
    Last Post: 05-15-2010, 06:47 AM
  3. Anyone Know How to Click A Button Using Javascript?
    By tradingjamie in forum JavaScript and CSS
    Replies: 1
    Last Post: 11-18-2009, 05:17 PM
  4. click ads on webpage using a button
    By evilhackerz in forum HTML Programming
    Replies: 5
    Last Post: 05-20-2009, 12:18 PM
  5. Button Click
    By Lop in forum C# Programming
    Replies: 5
    Last Post: 05-23-2006, 07:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

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