views:

246

answers:

1

Facebook has a special javascript call for setting Fanpage permissions. Unfortunately, I can't get any javascript to work on my page.

Not even a simple alert('bla') in an onclick works. Am I missing something?

This is the call I want to make:

Facebook.showPermissionDialog("publish_stream", ondone, showProfileSelector, [000000]);
+1  A: 

In your example, I think ondone should be "ondone". You have to refer to callbacks by name (as strings) if I recall correctly.

It has to do with FBJS being rewritten before it executes (all that pre-pending random strings/numbers/etc. stuff) and thus the ondone function no-longer existing as a callback.

Alternatively, try declaring the ondone function inline and see if that helps.

There could be more going on here (if literally no javascript works) but based on what's in your questions that'd be my first guess.

Kevin Montrose
You're absolutely right.I took the example code from the API documentation:http://wiki.developers.facebook.com/index.php/Facebook.showPermissionDialogThere the permissions (like "publish_stream") had quotes, but the others didn't. So I thought it had to be omitted.
skerit
Yeah, don't trust the wiki examples. They're oftentimes outdated.
Kevin Montrose