Writing <layer src=...> problem using javascript

liunx

Guest
I found a cool way to use an html file as a template for an entire site and it works perfectly in Internet Explorer. Unfortuantely it does not work in Netscape 4.x. I tried different things and found out that netscape does not like to write the following:<br />
<br />
document.writeln('<LAYER SRC=http://www.htmlforums.com/archive/index.php/"'+theurl+'" WIDTH=480 HEIGHT=1250 LEFT=160 TOP=175>');<br />
<br />
take out the src= <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/and">http://www.htmlforums.com/archive/index.php/and</a><!-- m --> it works fine, but I need the src to write out. If in it netscape just keeps loading, any clues how to fix this would be greatly appreciated.<!--content-->hi m8<br />
<br />
<br />
IIS servers (asp) support includes and you can use as many as you want.The code is executed server side and only the html is sent to the browser so compatability is not a problem.The following is an example.The file include could contain another table, a whole page, graphics, whatever<br />
there are a couple of free hosts about, the url of one is below<br />
<br />
<br />
<table><br />
<tr><br />
<td><br />
<!--#include file="main.inc"--><br />
</td><br />
<td>the include is on the left<br />
</td><br />
<tr><br />
</table><br />
<br />
<!-- m --><a class="postlink" href="http://www.brinkster.com">http://www.brinkster.com</a><!-- m --><br />
<br />
Dafunk<!--content-->Why not create the layer dynamically using the new layer constructor instead of trying to write it to the page ?<br />
(you will have to call the function from the onload event handler or otherwise .. after the body part HAS loaded).<br />
<br />
<script language='Javascript1.2'><br />
function whenPageLoaded(){<br />
newLayerObj = new Layer(400,window);<br />
newLayerObj.bgColor = 'red';<br />
newLayerObj.pageX = 200; newLayerObj.pageY = 400;<br />
newLayerObj.load('somepage.html');<br />
newLayerObj.clip.bottom = 400;<br />
newLayerObj.clip.top = newLayerObj.clip.left = 0;<br />
newLayerObj.clip.right = 400;<br />
<br />
// important to clip images AFTER loading external contents<br />
}<br />
</script><br />
</head><br />
<body onload="whenPageLoaded()"><br />
...<br />
</body><!--content-->
 
Back
Top