gpt4 book ai didi

jquery - colorbox.close Firebug 错误

转载 作者:行者123 更新时间:2023-12-01 06:07:05 24 4
gpt4 key购买 nike

我在 colorbox iframe 中有一个表单:

$(".contact_usModal").colorbox({iframe:true, innerWidth:670, innerHeight:515});

我使用上面的内容来触发链接,并且颜色框可以正常打开。

然后我想在单击提交按钮并发布数据时关闭颜色框。但这就是棘手的地方,因为我设置的验证器和 ajax 帖子在某种程度上干扰了表单提交时颜色框的自动关闭。

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
},

},

});
});

另外请注意,我在 firebug 中收到此错误:

http://witnessemcee.com 的权限被拒绝从 http://www.witnessemcee.com 获取属性 Window.$ 。父级.$.fn.colorbox.close();

谢谢。

约翰

最佳答案

Both comments from you guys worked! It was a subdomain issue as well as a code issue. Here is what i did.

Made my domain redirect to show no www in the address bar, using cpanel but can be done with .htaccess direct.

Also i used this code for the color box close and it worked.

parent.$.fn.colorbox.close()

(摘自OP编辑的问题)

关于jquery - colorbox.close Firebug 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4690357/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com