2
我有一个颜色框iframe中的一种形式:colorbox.close Firebug的错误
$(".contact_usModal").colorbox({iframe:true, innerWidth:670, innerHeight:515});
我用上面的触发链路和颜色框打开罚款。
然后我想关闭提交按钮点击和数据发布上的colorbox。 但这是棘手的地方,因为我设置的验证器和ajax发布不知何故干扰了表单提交上的自动关闭colorbox。
SubmittingForm=function() { // form validetd now do the following
var txt = $.ajax({
url: "process.php",
async: true,
type:'POST',
data:({
name:$('input#name').val(),
email:$('input#email').val()
})
}).success;
// I have tried both options below - they are taken from the colorbox javascript file.
// Usage format: $.fn.colorbox.close();
// Usage from within an iframe: parent.$.fn.colorbox.close();
$.fn.colorbox.close();
parent.$.fn.colorbox.close();
}
$(document).ready(function() {
$("#myform").validate({
submitHandler:function(form) {
SubmittingForm();
},
rules: {
name: "required",
email: {
required: true,
email: true
},
},
});
});
也只是为了说明,我的萤火得到这个错误:
权限遭拒,http://witnessemcee.com来获得属性窗口$从http://www.witnessemcee.com。 。父$ fn.colorbox.close()。
谢谢。
约翰
我不知道。但通常不可能从父文档跨不同子域获取属性。 www.witnessemcee.com和witnessemecee.com?你可以尝试使用相同的域名吗?这只是一个可能性...我不知道。 – Curlas 2011-01-15 15:18:52