In the last few days, Facebook has changed the “invite your friends” functionality, which powers suggestions and invitations to events, groups, pages, etc.
The result is that old Javascript codes that allowed you to invite ALL your Facebook friends to an event in a snap (such as this) are now broken.
To select all your new friends in the new interface you can use this code, tested under Safari 5.0.4, Chrome 10 and Firefox 4 (should work also under IE).
UPDATE: There are many reports of it working on newer versions in the comments below.
javascript:var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');
In order to use this code, copy and paste it in the address bar of your browser after you have opened the “invite your friends” dialog and AFTER YOU HAVE SCROLLED DOWN THE LIST.
Important note: as said, you HAVE to scroll down your friends list in order to invite all your friends: in fact the new interface only loads few friends via AJAX at a given time.
Facebook should definitely be a little more open regarding MY data, loaded on their systems… and this script opens it just a bit more.
DISCLAIMER: I DO NOT ASSUME ANY RESPONSIBILITY WHATSOEVER FOR THE USAGE OF THIS CODE; IF YOU GET BANNED BY FACEBOOK, OR ANYTHING ELSE, YOU WILL BE CLAIMED THE SOLE RESPONSIBLE FOR SUCH ACTIONS.


#1 by matthew on 08/11/2011 - 06:25
javascript:var x=document.getElementsByTagName(“input”);for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');
#2 by Seth Kean on 11/11/2011 - 05:31
I updated to Firefox 8 and now none of the codes are working. Does anyone have an idea of what to do? Would downgrading be easier?
#3 by SB on 13/11/2011 - 19:22
Thank you for sharing this code! It makes things much easier!!
#4 by Avalanche Center on 17/11/2011 - 06:37
Nov 16 21:34 PST – Seems to have worked fine for promoting our fall auction in Dec. Took a long time but selected all. After submitting it there was a delay and then a captcha to enter. Then after a not too long delay it said invitations had been sent. It still takes a little while to actually process them, I reloaded the event page periodically and the number invited kept increasing until everything had been sent.
Thanks for this!
#5 by Avalanche Center on 17/11/2011 - 06:38
Forgot to include the browser used: IE8
#6 by Ann on 20/11/2011 - 22:11
I used your code and put it in the address bar; then I opened up my facebook friends list all the way to the bottom. Then I opened the invite that I wanted sent out. It went out but I do not know if everyone received it. I hope that I did it correctly.
#7 by VideoByEmail on 26/11/2011 - 16:09
Hi,
Thanks for this post.. Do you have an update on how to invite all friends to a fan page. How to suggest friends to a fan page? All i see on a fan page now is share? Thanks
#8 by Rippa on 01/12/2011 - 10:21
Hi, It kind of worked for me but the invites weren’t sent out
The pop out prompted me that all has been selected but when re-open the invite box ppl still aren’t invited
is this happening to you as well ?
using safari
Thanks
#9 by kumjynhtbgvrf on 02/12/2011 - 02:31
It keeps sending me to Bing.com! wtf
#10 by boey on 04/12/2011 - 09:35
hi, how can i easy tag my friend in 1 photo?
#11 by boey on 04/12/2011 - 09:36
hi, fb was uodate, this code only work in page, cant work in group?
#12 by tammie mclin on 05/12/2011 - 03:58
javascript:var x=document.getElementsByTagName(“input”);for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');
#13 by Brozilian on 05/12/2011 - 05:59
I CAN HELP!!!
When you copy that link and paste on the browser, you can see that it actually doesnt paste the JAVASCRIPT: so, you have to write it and paste the link
#14 by yoyoyyyi on 06/12/2011 - 14:56
doesnt work brozillian, and what do you even mean, when i paste the url into the address bar, its the same as the one i find on this site. please explain further.
#15 by ChristmasGuy on 06/12/2011 - 18:32
It doesn’t work on IE9 and Firefox 8.
Unfortunately i’ve both of them :-(
So can’t test this !
#16 by Sasuke Uchiha on 11/12/2011 - 09:01
Not sure if i’m in the right place like, but everything else worked fine on chrome…
What do the FB friend rankings numbers represent exactly… I see figures but don’t know what they relate to… any ideas??
#17 by monisha shah... on 24/12/2011 - 05:55
woahhh!….
#18 by Danny on 28/12/2011 - 14:45
i am using google chrome
can someone please email me a link to invite all friends to an event.
I have about 2500 friends
#19 by Mike on 07/01/2012 - 06:55
thanks for the article and I found this useful to share:
http://codingninja.net/article/117/How-To-Invite-All-Of-Your-Friends-On-Facebook
#20 by james on 15/01/2012 - 22:40
its not working..
#21 by Dennis on 17/01/2012 - 20:26
Works perfectly using Safari and Mac OS 10.6.8
Thanks!
#22 by da rocking guy on 19/01/2012 - 08:31
this does not work !
#23 by MATT on 22/01/2012 - 05:13
I have tried the following article and the code works perfectly :
http://codingninja.net/article/117/How-To-Invite-All-Of-Your-Friends-On-Facebook
#24 by Bryan on 29/01/2012 - 23:06
I have the code to invite all friends for invites and suggestions, but
is there a code to select all friends when “sharing” a post or page??
#25 by Pam Stevens on 31/01/2012 - 17:11
Hi guys, I have tried everything you told me to and still having trouble. I click invite friends and then scroll all the way down until all of my friends show up. I then paste the code in the webpage box at the top. Nothing happens. What am I missing? Is the UL different from the place you put the web address? :-(