1

I'm using jQuery colorbox and load HTML into an iframe. All is working okay. While the iframe loads, I wanted to display a message along the lines of "stand by the page is loading"

I tried using the callback interface....if I use the traditional example of sending an alert prior to the load/open event, it works okay. If I try to use document.write to display a message, I see the message but the iframe doesn't load.

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

                                });

What am I doing wrong?

Matt Ball
  • 332,322
  • 92
  • 617
  • 683
user1197071
  • 31
  • 1
  • 2
  • 4

1 Answers1

1

Don't use document.write() after the page has loaded. If you do, it will completely stop out the document's contents. In fact, just don't use document.write() at all.

If you need something better than alert() for testing & debugging (you do) use console.log().

Community
  • 1
  • 1
Matt Ball
  • 332,322
  • 92
  • 617
  • 683