TypeError: container is undefined

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TypeError: container is undefined

pixelwiz
Hi, I'm trying to get the below test to work.  I need to be able to trigger the shadowbox to come up with some HTML based on some prior DB logic, so I need to trigger the open with JS not onclick or window.onload.  So I'm trying to do the below and I'm getting the container is undefined error.  I also tried it inside the $(document).ready with same result

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shadowbox Text</title>

<link rel="stylesheet" type="text/css" href="/offline/shadowbox.css" />
<script type="text/javascript" src="/offline/chrome.js"></script><script type="text/javascript" src="/offline/jquery-latest.js"></script>  <script type="text/javascript" src="/offline/shadowbox.js"></script>

<script type="text/javascript"> Shadowbox.init({ skipSetup: true, onOpen: function() { $('#sb-title').after($('#sb-info')); } }); function openShadowBox() { Shadowbox.open({ player: 'iframe', content: '/offline/maint_text.cfm', width: 350, height: 325 }); }; </script></head>

<body>

</body>
<script type="text/javascript"> if(1==1) { //alert("Please work"); openShadowBox(); } </script></html>
Reply | Threaded
Open this post in threaded view
|

Re: TypeError: container is undefined

pixelwiz
Turns out doing this worked:
$(window).load(function() {
                 openShadowBox();
});