Ever Changing (Evolving) Facebook API Stikes Again – AJAX is the Victim!
The other day I noticed that some of our applications that used Facebook FBJS AJAX calls were not working properly. One or two clients made mention of it so I decided to research further.

AJAX calls that once worked on Facebook where now returning a “not so descriptive” error message:
There was an uncaught Ajax error. Please attach on onerror handler to properly handle failures.
After some research I discovered that suddenly the Facebook AJAX call was no longer accepting URLs to CANVAS pages. In the past the thinking was simple, make an AJAX call to a canvas page and the page receiving the call has access to the Facebook API (user object, datastore, messaging, notification, i.e.)
The “fix” is simple, where ever you make a AJAX call to a canvas page URL that looks like this:
ajax.post(“http://apps.facebook.com/MYAPP/ajax.php”)
You need to change it to point to a page that hangs off your call back URL, so something like this:
ajax.post(“http://my.call-back-url.com/appdirectory/ajax.php”)
The real problem is you many need to rewrite the page you were making the call to since the previously used technique of accessing the Facebook API via an AJAX call no longer seems to be working! Here are some thoughts and recommendations:
- If you are associated user data in your database using a user’s Facebook ID (which you should), you will need to send that with your AJAX call (appending as part of a query string)
- User preferences that need to be changed using AJAX should be moved from the Facebook database to your database (ouch!)
- Example all your ajax calls (hopefully you have them organized seperated) to make sure none of them require that the Facebook API be included. “Silent calls” that are used to trigger notifications or updates may have stopped working without your knowledge. (versus more visible UI calls that may simply ‘break the app’)
Metablocks Clients: By now, all your Facebook applications should have been updated to address this change to the API. If you have any questions or concerns, please contact your account manager.
Most Recent Posts
- Google is Indexing Adobe Flash Files (SWFs) - SEO for Flash Widgets? - December 16th, 2009
- Widget News and Trends: Dec 16, 2009 - December 16th, 2009
- Recent Widget Blog Posts - December 15th, 2009
- Matthew West's Facebook Page - Why Every Artist Needs One! - December 14th, 2009
- CareerBuilder "Re-selling" Facebook? Yikes! - December 14th, 2009
Last 5 posts in Facebook
- Matthew West's Facebook Page - Why Every Artist Needs One! - December 14th, 2009
- Recent Facebook Projects - June 15th, 2009
- Changes on Facebook - June 12th, 2009
- Tab Content Manager for Facebook Pages - April 6th, 2009
- Facebook Page Redesign: Best Practices - April 2nd, 2009


