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 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Direct url to a page with iframe (Using Redirects with iFrames)

    I am using a main page (html) that has content as well as a iframe in it. I also have another page that loads into the main iframe, but my problem was that i wanted a direct URL for each page that goes into the iframe.

    Page 1 was this:
    http://realservices.ca/multimedia/mm...s_branded.html

    I was given the following java code and told to put it in the HEAD of that page and it would allow me to give a direct url to the second page and loading it in page 1 iframe:

    Code:
    <script language="javascript">
    var fname="content";     //MAIN CONTENT AREA FRAME **NAME**
    
    window.onload=function(){
    var d=document.location.search;
    if(d!='')top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
    }
    </script>
    After adding the above script to Page 1, I simply add ?vt to the end of the URL and that loads the index.html from my another folder in the same root (vt) into the iframe and allows me to use a specific url to get to it:

    http://realservices.ca/multimedia/mm...randed.html?vt

    My question is, does this make any sense and although i do see it working.....will i run into any issues? I could just drop in a seperate html page for page 2 (using page 1 but pointing the iframe to the new page), but i would prefer to just use 1 page is possible.

    Thx for any help in advance and hopefully i explained it somewhat ok.
    Last edited by cjack; 07-27-2009 at 08:20 PM.


 

Posting Permissions

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