Cannot load html file

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

Cannot load html file

Chris
Hi,

I seem to have problem in Shadowbox for loading external html file.  My Web page code is

<!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>

<link rel="stylesheet" type="text/css" href="css/shadowbox.css">
<script type="text/javascript" src="js/shadowbox.js"></script><script type="text/javascript"> Shadowbox.init({ players: ["img","swf","html"] }); </script>
</head>

<body>

<a rel="shadowbox;width=600"; class="option" title="This is a test" href="test.htm"><img src="icon.jpg"  width="90" height="90" /></a>
</body>
</html>


When I click on the image of icon.jpg, the Web page just gets dark and the external test.htm is not loaded.  If I replace test.htm to some other image or swf file, it works correctly.

Just don't know how the test.htm will not be loaded here.

Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Cannot load html file

sivel
Keep in mind that the default background for the content of the shadowbox is black which is also the default color for text.  So if your test.htm file is not specifying the background color for the body then you will looking at black text on a black background.

Try adding the follow code to the head of your test.htm and see if it helps:

<style type="text/css">
        body {
                background-color: #fff;
        }
</style>
Reply | Threaded
Open this post in threaded view
|

Re: Cannot load html file

Chris
In reply to this post by Chris
I just set the background color of test.htm to white, also the text color to red, but still got the same dark result.

My test Web page is at http://www.arstrio.com.tw/temp/test1.htm

What could be wrong ?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot load html file

fefelover
In reply to this post by Chris
Same thing is happening to me, mine just loads dark, but the htm page never appears.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot load html file

sivel
In reply to this post by Chris
When displaying an html FILE it uses the iframe player.  The html player is for displaying inline html.

Add iframe to the list of players and it should work for you.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot load html file

JoT8686
In reply to this post by Chris
I realized what you were talking about with the player and yanked the code from the example page:

<script type="text/javascript"> Shadowbox.init({ language: 'en', players: ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'] }); </script>
Using that code fixed the loading nothing problem for me, it probably will for you guys, too.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot load html file

theletterlist
Just a quick question I'am new to Java and Shadowbox.,

I have followed the steps to get a html file to load in shadowbox - by means of an "iframe".

So to the question how do i get shadowbox to load the css attached to the html file into the iframe?.

I have found this code to enable java to load a html+css file in an i frame if the iframe was called "frame"
//---------
var ss = document.createElement("link");
ss.type = "text/css";
ss.rel = "stylesheet";
ss.href = "style.css";

var iframe;
if(document.frames)
        iframe = document.frames["frame"];
else
        iframe = window.frames["frame"];
if(document.all)
        iframe.document.createStyleSheet(ss.href);
else
        iframe.document.getElementsByTagName("head")[0].appendChild(ss);
//---------

I could be heading down the wrong track here.

what is the iframe generated by shadowbox called ?.. or is there a simple way of going about this ?


Thanks for your time.