FaceBook Likes Javascript

Invite friends to your Facebook page with Javascript

March 21, 2013 10:35 am Published by Leave your thoughts

Do you have a Facebook Page? Perhaps your business does and you need a way for your Administrators of your Facebook Page to Invite Friends. We’ll give you Javascript code for the section highlighted red above to instantly invite all of your Facebook friends on the list.

There’s two ways to do this.

Option 1 – Google Chrome

  1. Go to your Facebook page and make sure your see the Admin view. If you cannot see the above then press the button ‘Show’ at the top right of the Facebook Page.
  2. Once you see what we see (demonstrated in the red circle above) open up Google Chrome’s Javascript Developer Console by pressing CTRL + CHIFT + J.
  3. Paste the code below (CTRL + V) within the window and hit ENTER. You will see all the friends disappearing from the list.
var inputs = document.getElementsByTagName("input"); for (var i=0; i < inputs.length; i++) { if (inputs[i].getAttribute('value') == 'Invite') { inputs[i].click(); } }

 

Option 2 – All other browsers

  1. ¬†Go to your Facebook page and make sure your see the Admin view. If you cannot see the above then press the button ‘Show’ at the top right of the Facebook Page.
  2. In the URL bar (where you type a website address) copy (CTRL + C) and paste (CTRL + V) the following code:
javascript:var inputs = document.getElementsByTagName("input"); for (var i=0; i < inputs.length; i++) { if (inputs[i].getAttribute('value') == 'Invite') { inputs[i].click(); } }

Note: at the time of writing this Google Chrome will strip out the ‘javascript:‘ part of the code so you must enter this manually.

Categorised in: ,

This post was written by Steven Sullivan

Leave a Reply

Your email address will not be published. Required fields are marked *