SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need to send data from 1 frame to another

    Hi

    I am working on a website where I have a mall map and then in the other frame
    when you hover over a store name, it places hover text over the mall map.
    Right now when you hover over the store name in the right frame, the data displays inside that frame.

    How do I get it to display over the mall map intead?

    Thanks.

    Link: http://dgssi.com/barton/directory.html

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Posts
    41
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    When I hover over a store in the right iframe, I don't see any "data" being displayed in that frame...
    In the iframe, you could call a parent javascript function, so a javascript function which is in the "directory.html" file, maybe that's the way to go for you?

    E.g.: onhover="parent.myFunction()".

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Provided the pages in each frame are on the same domain you can simply reference the elements in the other frame by using parent to refer to the parent page and the frame name to go down into a specific frame with that reference.

    If the pages are on different domains then you will need to use JavaScript in both pages and use a postMessage call in one to send a message and attach a message event listemer to the other to receive and process the message.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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