Hi all,
I am trying to use the code below so as to create a frame source string
dynamically. The idea is to verify if this index page is the parent or if it
called by an orphan page, in which case the orphan page passes its own name
as an argument to the index page.
Unfortunately, the code below returns an unspecified error.
This code is what is intended to create the index.htm page as it opens.
<HTML><TITLE>....</TITLE>
<SCRIPT type="text/javascript">
function window.onload()
{
checklocation();
}
function writetop()
{
document.body.insertAdjacentHTML('beforeEnd','<FRA MESET cols=20%,*
FRAMEBORDER="1" BORDER="1" scrolling=auto>')
document.body.insertAdjacentHTML('beforeEnd','<nof rames>')
document.body.insertAdjacentHTML('beforeEnd','</noframes>')
}
function writebottom()
{
document.body.insertAdjacentHTML('beforeEnd','</FRAMESET>')
document.body.insertAdjacentHTML('beforeEnd','</HTML>')
}
function checklocation()
{
//alert(top.location.href.length);
var theData;
var begin;
begin = top.location.href.indexOf("?");
if (begin > 0 )
{
theData = top.location.href.substring(begin+1,location.href. length);
theData = unescape(theData);
writetop();
document.body.insertAdjacentHTML('beforeEnd','<FRA ME name=main
src="files/ + theData + ">')
}
else{
writetop();
document.body.insertAdjacentHTML('beforeEnd','<FRA ME name=main
src="files/Help.htm">')
}
writebottom();
}
</script>
<body>
</body>
</html>
TIA
Phil
http://uk.geocities.com/philippeoget/a2z/