开发者

ie9: annoying pops-up while debugging: "Error: '__flash__removeCallback' is undefined"

I am working on a asp.net mvc site that uses facebook social widgets. Whenever I launch the debugger (ie9 is the browser) I get many error popups with: Error: '__flash__removeCallback' is undefined.

To verify that my code was not responsible I just created a brand new asp.net mvc site and hit F5. If you navigate to this url: http://developers.facebook.com/docs/guides/web/#plugins you will see the pop-ups appearing.

When using other browsers the pop-up does not appear. I had 开发者_Go百科been using the latest ie9 beta before updating to ie9 RTM yesterday and had not run into this issue.

As you can imagine it is extremely annoying... How can I stop those popups? Can someone else reproduce this?

Thank you!


I can't seem to solve this either, but I can at least hide it for my users:

$('#video iframe').attr('src', '').hide();
try {
    $('#video').remove();
} catch(ex) {}

The first line prevents the issue from screwing up the page; the second eats the error when jquery removes it from the DOM explicitly. In my case I was replacing the HTML of a container several parents above this tag and exposing this exception to the user until this fix.


I'm answering this as this drove me up the wall today.

It's caused by flash, usually when you haven't put a unique id on your embed object so it selects the wrong element.

The quickest (and best) way to solve this is to just:

add a UNIQUE id to your embed/object

Now this doesn't always seem to solve it, I had one site where it just would not go away no matter what elements I set the id on (I suspect it was the video player I was asked to use by the client).

This javascript code (using jQuery's on document load, replace with your favourite alternative) will get rid of it. Now this obviously won't remove the callback on certain elements. They must want to remove it for a reason, perhaps it will lead to a gradual memory leak on your site in javascript, but it's probably trivial.

this is a secondary (and non-optimal) solution

    $(function () {
        setTimeout(function () {
            if (typeof __flash__removeCallback != "undefined") {
                __flash__removeCallback = __flash__removeCallback__replace;
            } else {
                setTimeout(arguments.callee, 50);
            }
        }, 50);
    });

    function __flash__removeCallback__replace(instance, name) {
        if(instance != null)
            instance[name] = null;
    }


I got the solution.

try {
  ytplayer.getIframe().src='';
} catch(ex) {
}


It's been over a months since I last needed to debug the project. Facebook has now fixed this issue. The annoying pop-up no longer shows up. I have not changed anything.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜