This Javascript Invite Code Doesn't Work For Facebook..Help?

by 6 replies
8
Hey Coder Gods...

I'm absolutely furious right now b/c I need a really efficient way to suggest a page to friends on facebook.

I was wondering if anyone knows why the following Javascript code won't work to highlight all my friends on Facebook in the "suggest to friends" area.

Code:
javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var  fid in elms){if(typeof elms[fid] === 'object'){fs.click(elms[fid]); } }
I'm at a loss...I've seen this thing suggested in multiple spots and tried to use it in Firefox and Internet Explorer.

IE returns an error but firefox doesn't say anything.

Thanks for any help.

Brad
#programming #code #facebookhelp #invite #javascript #work
  • Anyone?

    Cheers,

    Brad
  • Is this called when the page loads or is there something that triggers the function? Also, check typeof elms[fid] == "object"
    • [1] reply
    • Hey Vince,

      I was told to enter that into the "http://www" part of the browser and hit enter and it would highlight friends to suggest.

      I can't see why it doesn't work...but I'm so retarded with this type of stuff...I just want to invite my friends to my deli's fan page

      Thanks,

      Brad
  • Instead of this:
    if(typeof elms[fid] === ‘object’)

    try this:
    if(typeof elms[fid] == ‘object’)
    • [1] reply
    • Thanks for taking your time. I found a greasemonkey script that does what I needed. Whew...something easy.

      I appreciate your effort!

      Brad
  • Hey everyone,

    I pointed Brad to the Greasemonkey script that he is using.

    A full description of what was happening is outlined on my blog here:
    http://www.augustmalson.com/2011/04/...friend-script/

    But here is what we were running into:
    The script works, but only in a specific situation. As a user of Facebook, when you go to edit YOUR friends, you can use the above friends to create a list. However, when you go to create a Fan page, and you try to Suggest to Friends, you start getting Javascript errors, because it does not exist in the same path as the "edit friends" page.

    For further information check out the above link, and if you are able to find a work around to the browser security exceptions that I was running into, please let me know, and I will update my code.

    Thanks!

    Augie/CaesarGus

Next Topics on Trending Feed