944,113 Members | Top Members by Rank

Ad:
Oct 25th, 2009
0

Iframe src to change the src of another Iframe

Expand Post »
Getting to the poiint; I have a 'index.html' document that creates 3 iframes, each within a row of a 1 column, 3 row table. So I have a top (frame1), middle,(frame2) and bottom(frame3).

Frame1 src="header.html" is a descriptive banner.

Frame2 src="Start.html" is where the real application does all the work.

Frame3 src="footer.html" is a footer, that may contain 1 or more images or small buttons.

I will include the code for index.html at the end:

What I can't seem to do is have "start.html" change the content or src of frame1, recall start.html is the src of frame2. When a button within a form within start.html is pressed (onclick), a cgi (c program) outputs new html into frame2, a mainmenu of buttons. Now frame2 contains a list of buttons, and I want frame1 to contain text "Main Menu". Likewise, in the mainmenu, when the settings button is pressed a cgi program will output the settings HTML to frame2, and I want frame1 to contain the text "Settings".

Sure, the cgi program could change/re-write the contents of "header.html", but whats the best method, and then, how to reload the iframe, or change it's src.

frame2 needs to modify frame1 and later frame3.

Thanks in advance,

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <title>test run</title>
  4. <link rel="stylesheet" type="text/css" href="stdtheme.css" />
  5. </head>
  6. <center>
  7. <body>
  8. <br>
  9.  
  10. <table border="0" class="maintable" cellpadding="0" cellspacing="0">
  11. <tr>
  12. <td align="top">
  13. <iframe id="frame1" name="frame1" class="result_output" width="115%" height="27px" frameborder="0" scrolling="no" name="head"
  14. src="header.html"></iframe>
  15. </td>
  16. </tr>
  17. <tr>
  18. <td valign="center">
  19. <iframe id="frame2" class="result_output" width="115%" height="630px" frameborder="0" scrolling="yes" name="view"
  20. src="startup.html"></iframe>
  21. </td>
  22. </tr>
  23. <tr>
  24. <td align="bottom">
  25. <iframe id="frame3" class="result_output" width="115%" height="27px" frameborder="0" scrolling="no" name="foot"
  26. src="footer.html"></iframe>
  27. </td>
  28. </tr>
  29. <tr>
  30. <td align="left" class="bottomtext">
  31. bottom line text
  32. </td>
  33. </tr>
  34. </table>
  35. </center>
  36. </body>
  37. </html>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
3000MAN is offline Offline
2 posts
since Oct 2009
Oct 25th, 2009
0
Re: Iframe src to change the src of another Iframe
Can anyone recommend another method?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
3000MAN is offline Offline
2 posts
since Oct 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Toggle div visibility
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: AJAX/PHP to open a certian window according to the variable received.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC