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