Forum Moderators: open

Message Too Old, No Replies

Javascript iframe problem

javascript iframe making me lose my footer

         

drath7875

9:21 pm on Nov 17, 2009 (gmt 0)

10+ Year Member



I have built my site using an index.html page with my Logo banner, flash video, nav bar and footer and near the bottom of the page above the footer I have an iframe named "main". I set the links to open my content pages in the iframe. This looks great but I later found out gives me SEO problems. My content pages are all over Google and have no index page. I used the Javascript solution posted in this forum under post #3751651. The solution works by forcing the index page to be loaded with the content page in the javascript iframe. But the problem I am having now is that the table rows containing my footer are gone and I have an empty box on my page. The table rows are directly after the javascript I inserted into master.html (duplicate of index.html). This is the first time I have used java. Any help would be greatly appreciated.

Here is my home page and it shows the website correctly.
<snip>

Here is a link to the About US.htm that uses the master.html and javascript fix.

http://www.example.com/master.html?http://www.example.com/About_Us.htm

Here is my code for the portion of the master.html file where I inserted the javascript. Again, any help would be greatly appreciated! Thanks in advance!

<td width="1000" height="498" align="center">
<!-- Orphaned Content Page Fix -->
<script language="JavaScript" type="text/JavaScript">
origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)

document.write('<iframe src=\"' + contentURL + '\" name="main" width="1000" height="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto"><\iframe>')
</script></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="3">&nbsp;</td>
<td width="1000" height="3"><div align="center"><img src="images/Home%20Page/Footer-bar.png" width="1000" height="3" alt="Footer Bar"></div></td>
<td height="3">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td height="20"><div align="center"><img src="images/Home%20Page/Footer.png" alt="Address &amp; Phone Numbers" width="1000" height="45"></div> </td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

[edited by: bill at 2:25 am (utc) on Nov. 18, 2009]
[edit reason] No links to your own sites or examples please [/edit]

whoisgregg

8:28 pm on Dec 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, drath7875!

The closing tag for the iframe uses the wrong type of slash. Instead of <\iframe> try using </iframe>.

If that doesn't sort it out, please post back and we'll take another look. :)