patrik
09-13-2002, 06:47 PM
Has anyone had any luck using javascript to conditionally load a Server Side Include?
It would seem quite simple, but this is causing me to pull my hair out in frustration!
<script language="JavaScript">
if (self==parent)
document.write('<!--#include virtual="../../HeaderNavAlt.html" -->');
</script>
What this is supposed to do is to confirm the page is not in a frameset, and if so then insert HeaderNavAlt.html (containing a scripted navigation set). Behaviour of the "parent" file is bizarre - sometimes the SSI file mostly works, sometimes when I open the parent file, the reference ("#include virtual = etc") to the SSI is magically gone, and the actual code from the SSI file has been inserted en toto - but all wonky! It sometimes looks almost as if the #include statement is being executed no matter what - as if it weren't part of a conditional statement!
Am I having problems because the inserted file has scripts?
Does writing the SSI call itself in javascript screw things up?
...and what about Naomi?! (sorry...)
Thanks again to anyone who cares to offer some aid!
It would seem quite simple, but this is causing me to pull my hair out in frustration!
<script language="JavaScript">
if (self==parent)
document.write('<!--#include virtual="../../HeaderNavAlt.html" -->');
</script>
What this is supposed to do is to confirm the page is not in a frameset, and if so then insert HeaderNavAlt.html (containing a scripted navigation set). Behaviour of the "parent" file is bizarre - sometimes the SSI file mostly works, sometimes when I open the parent file, the reference ("#include virtual = etc") to the SSI is magically gone, and the actual code from the SSI file has been inserted en toto - but all wonky! It sometimes looks almost as if the #include statement is being executed no matter what - as if it weren't part of a conditional statement!
Am I having problems because the inserted file has scripts?
Does writing the SSI call itself in javascript screw things up?
...and what about Naomi?! (sorry...)
Thanks again to anyone who cares to offer some aid!