JSON length Causing Facebook Post to Wall Functionality to Break in IE8 & IE9

I have been using the Facebook Javascript SDK to post content from a CMS to a facebook fan page. It basically works by pulling the current pages content using jQuery and feeding it into FB.api function. Everything works fine in Firefox, Safari, Chrome, etc. The only problem is IE in which nothing happens, no error message, no javascript errors, nothing.

Here is the function I am using:

function Publish(){
    //variables pulled from page content like so:
    var fb_message = $('#content').text();

    FB.api('/me/feed', 'post',
    {
        access_token    : fb_token,
        name            : fb_name,
        message         : fb_message,
        link            : fb_link,
        picture         : fb_photo,
        caption         : fb_caption

    },function(response) {
        if (!response || response.error) {
            alert("Couldnt post"); 
        } else {
            alert('Posted');  
        }
    })
}

If I remove the message from the FB.api json, or limit the length of the string being sent to 850 chars it works fine even in IE, but I have no idea why? The string is just Loreum Ipsum, no odd characters or line breaks.

Update Actually seems that if I remove caption, name, link, etc and only post a 'message' in the json I can push a slightly longer message string through to facebook, which seems to point to the length of the json being some kind of problem...

Any pointers would be really appreciated.

Update I tried rewriting my functionality from scratch in a separate html file, still getting a problem in IE, so I have submitted a bug to Facebook. See what they have to say about it.

Answers


This has been recognized as a bug by the Facebook team, and they have plans to push a fix soon. You can see my bug report here.

UPDATE The fix was pushed, and the problem solved in IE9+. However IE7 and 8 still have problems with long strings. In fact they appear to have become more of a problem since the fix.


The message parameter is deprecated, you have to use the description parameter to post in a user feed,

https://developers.facebook.com/docs/reference/dialogs/feed/


Need Your Help

jQuery is not filtering/selecting on IE after ajax call

jquery ajax internet-explorer

I have the following code that works on firefox and chrome