Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery colorbox和onOpen回调事件_Jquery_Colorbox - Fatal编程技术网

jQuery colorbox和onOpen回调事件

jQuery colorbox和onOpen回调事件,jquery,colorbox,Jquery,Colorbox,我正在使用jquerycolorbox并将HTML加载到iframe中。一切正常。虽然 在iframe加载时,我想显示一条消息,内容是“等待页面加载” 我尝试使用回调接口…如果我使用发送警报的传统示例 在加载/打开事件之前,它工作正常。如果我尝试使用document.write显示消息, 我看到了消息,但iframe没有加载 //Examples of how to assign the ColorBox event to elements $("

我正在使用jquerycolorbox并将HTML加载到iframe中。一切正常。虽然 在iframe加载时,我想显示一条消息,内容是“等待页面加载”

我尝试使用回调接口…如果我使用发送警报的传统示例 在加载/打开事件之前,它工作正常。如果我尝试使用document.write显示消息, 我看到了消息,但iframe没有加载

            //Examples of how to assign the ColorBox event to elements
            $(".iframe").colorbox({
                                            iframe:true, width:"80%", height:"80%",
                                           onOpen:function(){document.write("fff"); }

                                });

我做错了什么?

加载页面后不要使用
document.write()
。如果这样做,它将完全停止文档的内容。其实,


如果您需要比
alert()
更好的测试和调试工具(您需要)请使用。

在加载页面后不要使用
document.write()
。如果这样做,它将完全停止文档的内容。其实,

如果您需要比
alert()
更好的测试和调试工具(您确实需要)请使用