Frame content controlling

Discussion in 'JavaScript' started by benone, Feb 26, 2007.

  1. #1
    Hello, I am reading and learning about JavaScript language, but couldn't have found any informations about frames controling. I am not sure whether my problem can be resolved using JavaScript, maybe AJAX will be more suitable.
    Generally I wonder about something like script which works in one frame and gets the informations about this what is loaded in the second frame.
    For example:
    I have a website which has 2 frames. One is large, wide, second one smaller. I am surfing in this wider one and script in the narrow frame takes the information about the link (address) which is loaded in the frame where I am surfing.

    I hope my example is easy to understand, btw sorry for my english, still learning aswell. :)

    So, is that possible ? To control the contet of one frame by script in another frame ?

    Is possible to send those informations to the server, to some PHP script for example ?

    I couldn't find any answer for that questions, but heard that JavaScript has a lot of possibilites on the client (browser) side.

    Thx in advance.
     
    benone, Feb 26, 2007 IP
  2. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #2
    This should work.
     
    Aragorn, Feb 27, 2007 IP
  3. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #3
    You can also use Ajax and PHP session to achieve the same output.
     
    Aragorn, Feb 27, 2007 IP
  4. benone

    benone Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks Aragorn. Will try and let you know how does it work.
    Will AJAX let me see the content from different domain ?
     
    benone, Feb 28, 2007 IP
  5. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #5
    Browsers have strict policy against cross domain access to the content of a frame from another frame. So the above script will work only if both the pages are from the same domain.
    Using Ajax you can see the contents from a different domain i.e., you can open a page from another domain. But Ajax cannot be used for accessing the content of another frame.
     
    Aragorn, Feb 28, 2007 IP
  6. benone

    benone Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    So, if AJAX let check the content of another domain website , is there any other solution to view that website on my website , any other than simple frames ?
     
    benone, Mar 1, 2007 IP
  7. Aragorn

    Aragorn Peon

    Messages:
    1,491
    Likes Received:
    72
    Best Answers:
    1
    Trophy Points:
    0
    #7
    Did you check it with different domains? Plz do so
     
    Aragorn, Mar 1, 2007 IP