views:

30

answers:

2

I'm trying to convert my once fully functional app from using the ancient feed templates to the new publisher stuff. However, when trying to init the new API I got the javascript error a28251737459_FB is not defined. Unable to debug or pinpoint the location of the error, I tried taking out everything on the app's main page except for <script> alert('Test'); </script>. It causes almost the same error as above, a28251737459_alert is not defined.

The weird part is that all my defined functions for Mock AJAX etc run just fine. I just seem to be unable to call any functions or refer to objects such as window/document/FB from the global scope of the script.

The app is in FBML canvas mode and running on my own virtual server under Apache 2. To replicate the error, click the form submission button.

Link to my app: http://apps.facebook.com/sendwhatever/

+2  A: 

FBML apps don't have full javascript support. They use facebook's own javascript implementation (wrapper) called FBJS.

You can't use javascript FB API inside FBML apps. What you can use is FBML tags. If FBML is not enough you can always use facebook API on your server side (php?), and then render page accordingly (or use ajax to ask server side for data, ajax is supported in FBJS).

serg
Wonderful, thanks! That definitely cleared a lot of things up.
Kaivosukeltaja
A: 

Facebook is appending your appID to every function, so alert('Test') changes its name, also alert boxes are not allowed in FBML canvas apps. You should use some FBML elements to show alert to the user

Tarun