Question regarding frames

Sorry (noob here!). I don't usually do javascript, i usually use a combination of flash and php and i'm kinda lazy to find the solution myself...*blushes*

Let's assume that we have two frames called 'links' and 'data'. The 'links' frame contains a bunch of hyperlinks which if clicked on changes the page content of the 'data' frame. Hmmm...I would like to know how to change both the URL in the address bar of the client's browser and at the same time changing the page contents of the 'data' frame when a link is clicked in the 'links' frame.

I hope I'm not too confusing here. ^_^" Your help is very much appreciated. ThX!

Comments

  • : Sorry (noob here!). I don't usually do javascript, i usually use a combination of flash and php and i'm kinda lazy to find the solution myself...*blushes*
    :
    : Let's assume that we have two frames called 'links' and 'data'. The 'links' frame contains a bunch of hyperlinks which if clicked on changes the page content of the 'data' frame. Hmmm...I would like to know how to change both the URL in the address bar of the client's browser and at the same time changing the page contents of the 'data' frame when a link is clicked in the 'links' frame.
    :
    : I hope I'm not too confusing here. ^_^" Your help is very much appreciated. ThX!
    :
    You can add query values to the address bar, but the URL of the top page cannot be changed using javascript.
    Here is a code to load a page in another frame: http://developer.irt.org/script/3.htm
    I don't know how to change the address bar without reloading the top page (if there is a way). If you reload the page, you need to redirect within the frame page. Here is an article about that: http://tech.irt.org/articles/js126/index.htm
  • : : Sorry (noob here!). I don't usually do javascript, i usually use a combination of flash and php and i'm kinda lazy to find the solution myself...*blushes*
    : :
    : : Let's assume that we have two frames called 'links' and 'data'. The 'links' frame contains a bunch of hyperlinks which if clicked on changes the page content of the 'data' frame. Hmmm...I would like to know how to change both the URL in the address bar of the client's browser and at the same time changing the page contents of the 'data' frame when a link is clicked in the 'links' frame.
    : :
    : : I hope I'm not too confusing here. ^_^" Your help is very much appreciated. ThX!
    : :
    : You can add query values to the address bar, but the URL of the top page cannot be changed using javascript.
    : Here is a code to load a page in another frame: http://developer.irt.org/script/3.htm
    : I don't know how to change the address bar without reloading the top page (if there is a way). If you reload the page, you need to redirect within the frame page. Here is an article about that: http://tech.irt.org/articles/js126/index.htm
    :
    hmmm...will look into this, but im hoping someone would give me a definite answer on whether this is possible? If it isnt i think im going to have to think up some fancy solution for the client...
  • you can change the address bar by using something like [b]window.location.href = 'http://newlocation';[/b] if you dont have frames, but to do it within frames you'd have to do something like [b]parent.location.href = 'http://newlocation';[/b] to get a child frame to change it's parent's location. sorry, im in my school's computer lab right now and can't test (mainly because im on a mac and can't figure out how to save something as plain text :-) ), but when i get home ill take a closer look at it if you need me to.

    but, the best way to do this doesn't require javascript. if you really want the url in the title bar to change, you should probably either make different html frame pages for each page or use javascript to load the correct page, rather than using it to change the address.. this is what i mean:

    psuedo-sortof-code for frames page (in this example index.html)
    [code]







    [/code]
    forgive me, its been a long time since ive used frames, so that may not be the correct way to do it, but you should get the idea..

    code for links.html
    [code]


    home

    test1

    test2



    [/code]

    home.html:
    [code]

    my home page

    [/code]

    test1.html:
    [code]

    this is test page 1

    [/code]

    test2.html:
    [code]

    this is test page 2

    [/code]

    again, sorry for errors in my examples. i can't test right now to be sure this is all right, but you should get the basic idea.
  • ok, change index.html to this and keep everything else the same and it should work:
    [code]






    [/code]
  • : ok, change index.html to this and keep everything else the same and it should work:
    : [code]
    :
    :
    :
    :
    :
    :
    : [/code]
    :
    wow!! will try this and see whether it works! Thx man!;)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories