How to Select All Friends to Invite To Event on Facebook (January 2015)

Ever wanted to invite all your friends to the event at once? It may be a difficult task to manually click on each check box until you select all your friends before sending the invite, especially when you have more than average number of friends.


Codes, some functional codes can make your job easy, really easy. We will use simply JavaScript code to achieve the results. Running one simple code will do the selection of all the friends in the invite box for you hassle free!

UPDATE: Code Updated for New Invite Interface

The only problem is the changing interface on Facebook, the codes and interface are when changed, there's 90% possibilities that the previous code might stop working, but we keep on checking and updating the codes, so no problem!

If you get the following Invite interface then the following code should work for you (carry on with the tutorial to learn how)


The Code

var all_checkboxes = document.querySelectorAll('a[role=checkbox]');
for (var i = 0; i < all_checkboxes.length; i++) {
    if (all_checkboxes[i].attributes['aria-checked'].value == "false") {
      all_checkboxes[i].click();
    }
}

The above code must work fine. But if doesn't try the other ones (mainly for browser compatability, using Chrome or Firefox (latest) is recommended).

Alternate code:
var all_items = document.getElementsByClassName('_1v30');
for (var i = 0; i < all_items.length; i++) {
    al_items[i].click();
}



Before you run the code

Before you run the code to select all the friends you better make all the friends in the list visible by scrolling till the end, if you don't do it then only the number of friends in the list that is currently available would be selected.

Run the code on Developer Console

The final step is to run the code on the invite page.

Shortcuts: Press CTRL+SHIFT+J (for Chrome), CTRL+SHIFT+K (for FireFox)

To do that see the detailed instruction on using Developer Consoles on different browser


Leave your comments below! If you got any errors then do tell us, we will try fix it. 

No comments:

Post a Comment

Leave a comment