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.i nsertAdjacentHT ML('beforeEnd', '<FRAMESET cols=20%,*
FRAMEBORDER="1" BORDER="1" scrolling=auto> ')
document.body.i nsertAdjacentHT ML('beforeEnd', '<noframes>')
document.body.i nsertAdjacentHT ML('beforeEnd', '</noframes>')
}
function writebottom()
{
document.body.i nsertAdjacentHT ML('beforeEnd', '</FRAMESET>')
document.body.i nsertAdjacentHT ML('beforeEnd', '</HTML>')
}
function checklocation()
{
//alert(top.locat ion.href.length );
var theData;
var begin;
begin = top.location.hr ef.indexOf("?") ;
if (begin > 0 )
{
theData = top.location.hr ef.substring(be gin+1,location. href.length);
theData = unescape(theDat a);
writetop();
document.body.i nsertAdjacentHT ML('beforeEnd', '<FRAME name=main
src="files/ + theData + ">')
}
else{
writetop();
document.body.i nsertAdjacentHT ML('beforeEnd', '<FRAME name=main
src="files/Help.htm">')
}
writebottom();
}
</script>
<body>
</body>
</html>
TIA
Phil
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.i nsertAdjacentHT ML('beforeEnd', '<FRAMESET cols=20%,*
FRAMEBORDER="1" BORDER="1" scrolling=auto> ')
document.body.i nsertAdjacentHT ML('beforeEnd', '<noframes>')
document.body.i nsertAdjacentHT ML('beforeEnd', '</noframes>')
}
function writebottom()
{
document.body.i nsertAdjacentHT ML('beforeEnd', '</FRAMESET>')
document.body.i nsertAdjacentHT ML('beforeEnd', '</HTML>')
}
function checklocation()
{
//alert(top.locat ion.href.length );
var theData;
var begin;
begin = top.location.hr ef.indexOf("?") ;
if (begin > 0 )
{
theData = top.location.hr ef.substring(be gin+1,location. href.length);
theData = unescape(theDat a);
writetop();
document.body.i nsertAdjacentHT ML('beforeEnd', '<FRAME name=main
src="files/ + theData + ">')
}
else{
writetop();
document.body.i nsertAdjacentHT ML('beforeEnd', '<FRAME name=main
src="files/Help.htm">')
}
writebottom();
}
</script>
<body>
</body>
</html>
TIA
Phil
Comment