Programming + Design

Home arrow Tips & Tricks arrow Javascript Tips & Tricks arrow Access Denied error in IE with Facebook Javascrkpt SDK
Access Denied error in IE with Facebook Javascrkpt SDK PDF Print E-mail
Written by Brett Brewer   
Wednesday, 12 January 2011

For anyone that's spent much time trying to implement the Facebook Javascript API on their web site, you may have come across some odd behavior or unexplained javascript errors in Microsoft Internet Explorer. One of the main causes of problems with the FB Javascript API in IE is a missing 'channelUrl' parameter in your FB.init() function call. To remedy such problems, you create a file such as "fbchannel.html" and in it you place the following contents.

<script src=""></script>
Then in your javascript code, where you call the FB.init() function, set up the parameters to include a channelUrl.
window.fbAsyncInit = function() {
            appId: '1234567890',
            status: true, cookie: true,
            xfbml: true,
            channelUrl: document.location.protocol + '//'
(function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +

You might also want to make the script src in the fbchannel.html file dynamic so that it loads over https for any secure pages, but if you don't need to load the facebook API on any secure pages, then don't worry about it. Also, be sure that if you have a separate test domain for your test site that you switch the domain for the channelUrl on your test site or you'll get the js error there too. 
Last Updated ( Wednesday, 12 January 2011 )
< Prev   Next >
© 2017
Joomla! is Free Software released under the GNU/GPL License.