View Full Version : javascript problem (newbie)

08-01-2006, 01:19 PM
I bought a template from template monster that has a built in html and javascript code. I am trying to modify it to create my own website.

The site has a flash banner at the top and the rest is in html. The site has 5 web pages and the javascript code allows you to visit those pages while still in index.html

function load_content () {
if (parent.document.getElementById('main_div')) {
parent.document.getElementById('main_div').innerHTML=document.getElementById('inner_frame').innerHTM L;
if (!parent.document.getElementById('main_div')) {

window.location=('index.html') ;
<body onload="load_content()">
<div id="inner_frame">

The problem arises when I try to create my own page. I am not familiar with javascript so I dont know how to change it to fix it. When I enter my page and click on any of the links in the banner I go directly to the main page, no matter which link I click on. How do I fix it?

Mr J
08-02-2006, 08:37 PM
Are you loading your pages into the iframe?

02-19-2007, 02:54 AM
Same exact script in my TM template and I can't load a page unless the link is in the header or footer so that it carries the "main_div" id. I can understand the code and why it's happening, but not sure how to get around it!? Seems to be a poor design.

I'm trying to make more pages by using the existing pages as templates, but they send me back to index.html because the link is in the body of the page.

Any ideas?