Entry
Can I load an external html file into a layer (with Server side) ?
Sep 30th, 2003 12:16
Klaus Bolwin, Ci Vic,
You can load external files into an iframe or object. Since iframes are
no longer standard in XHTML 1.0 you should prefer the object tag.
Another posibiltiy is to load the external file via anonymous content
and XBL. However this works in Gecko browsers only:
1.
The HTML-file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!doctype html public "-//W3C//DTD XHTML 1.1 Strict//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<script type="text/javascript">
function test1()
{
anonym = document.getAnonymousNodes(document.getElementById('test1'));
anonym[0].setAttribute('src',anonym[4].firstChild.selectedItem.getAttribute('value'));
}
</script>
<title>test</title>
<style type="text/css">
.test {-moz-binding:url('binding.xml#b1'); position:absolute; left:10%;
width:80%; top:10%; height:80%; background-color:blue;}
</style>
</head>
<body>
<div class="test" id="test1">
<br />This works in Gecko browsers only!
</div>
</body>
</html>
2. the file binding.xml:
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<binding id="b1">
<content>
<xul:browser src="http://www.faqts.com" style="width:100%;
height:100%;"/>
<children/>
<xul:box orient="horizontal">
<xul:menulist label="Faqts">
<xul:menupopup oncommand="test1()">
<xul:menuitem label="Faqts" value="http://www.faqts.com"/>
<xul:menuitem label="XULPlanet" value="http://www.xulplanet.com"
selected="true"/>
<xul:menuitem label="Selfhtml" value="http://selfhtml.teamone.de"/>
<xul:menuitem label="Mozilla" value="http://www.mozilla.org"/>
</xul:menupopup>
</xul:menulist>
</xul:box>
</content>
</binding>
</bindings>