So i have an iframe that populates based on different informational pages submitted by different offices. These pages are simple text in the frame. I used some code i found online to force people to use the iframe not to just view the informational pages. For some reason if i try to use the "target" command to change the content of the iframe it opens a new browser window with the information in it. I just wanted it to populate the iframe,
The js code for the iframe is this
Code:
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
var curl = location.search.substring(1) ? unescape(location.search.substring(1)) : 'About_Us/About_Us.htm';
document.writeln('<iframe id="aboutus" src="'+curl+'" width="100%" height="425" frameborder="0">');
document.writeln('<p>This page doesn\'t support iframes. You can <a href="'+curl+'?nf" target="_blank">view the page in a separate window<\/a> instead.<\/p>');
document.writeln('<\/iframe>');
/* ]]> */
</script>
<noscript>
<iframe src="About_Us/About_Us.htm" width="100%" height="420" frameborder="0" >
<p>This page doesn't support iframes. You can <a href="About_Us/About_Us.htm" target="_blank">view the page in a separate window</a> instead.</p>
</iframe>
</noscript>
the js i use to lock the subpages is
Code:
<script type="text/javascript" language="javascript">
if (self.location == top.location &&
location.search.substring(1) != 'nf')
top.location.href = '../About_Us_Home.htm?' + escape(self.location);
</script>
so when i use html to target a page I use
HTML Code:
<td>
<a href="About_Us/Message_From_The_President.htm" target="aboutus" class="style117">
<span class="style121">
Message From the President</span></a></td>
So what did I do wrong? Did I miss something? JS is not a language i realy understand so any help would be greatly appreciated.
Thanks
Chris
|