Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript problem (newbie)

    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


    Code:
    function load_content () {
    			if (parent.document.getElementById('main_div')) {
    				parent.document.getElementById('main_div').innerHTML=document.getElementById('inner_frame').innerHTML;
    			}
    			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?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Are you loading your pages into the iframe?
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •