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.)