Select/Invite all friends on Facebook automatically

Facebook recently updated the way they allow you to invite friends. Purposely or, as a side effect, it means that the popular javascript code that lets you select all friends no longer works. The following code courtesy of John P. allows you to select all friends on the new version. (Yay!)

There is one catch. Because Facebook now only loads a few of your friends at a time, you have to scroll all the way down the invite list until you hit the very bottom (all your friends are displayed). You then just paste the following into the URL bar and hit enter:

View Code JAVASCRIPT
javascript:function check_all_in_document(doc){var c=new Array();c=doc.getElementsByTagName('input');for(var i=0;i<c.length;i++){if(c[i].type=='checkbox'){c[i].click();}}}check_all_in_document(window.document);for(var j=0;j<window.frames.length;j++){check_all_in_document(window.frames[j].document);}

Happy inviting! (If the code doesn’t work then make sure you click “View Code” in the box above.)

9 thoughts on “Select/Invite all friends on Facebook automatically”

  1. You go to invite and then invite friends. In normal circumstances it will show a few of your friends to invite. For this code to work you simply keep scrolling down until it loads all of your friends. Once they’re all loaded you simply paste the code into the URL bar and press enter (it will then select them all). Hope that helps!

  2. Nikos,
    Click “View Code” on the box with the code, the preview does some weird things. Then just go to event -> invite friends
    in URL type:
    javascript:<paste the code>

  3. Jake,
    Tried it just now and it still works, though I noticed that sometimes Chrome removes the “javascript:” from the beginning of what I paste in so make sure its there (otherwise it’ll probably do a google search or similar!)

Leave a Reply

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