jQuery effect on iframe parent document

Posted by Jabes88 on Stack Overflow See other posts from Stack Overflow or by Jabes88
Published on 2010-02-02T01:55:37Z Indexed on 2010/05/26 9:31 UTC
Read the original article Hit count: 264

Filed under:
|
|
|
|

Just wondering if anyone else has experienced this or knows why I am getting an error. I'm using javascript from within an iframe to call a parent dom element then use jQuery UI's effect core to shake it. Here is an example:

$(document).ready(function(){
    if ($("form").length>0)
    {
        $("form").submit(function(){
            var oParentDoc = $(parent.document).find("div#element");
            var action = $(this).attr("action");
            var postdata = $(this).serialize();
            $(oParentDoc).addClass("loading");
            $.post(action,postdata,function(data){
                $(oParentDoc).removeClass("loading").effect("shake",{"times":3,"distance":10},60);
            });
            return false;
        });
    }
});

It works without the effect, but when I use an effect it gives me this error:

uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMCSSStyleDeclaration.getPropertyValue]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"

Thanks in advance for any insight :)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery