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 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Updating Parts of a Web Page

    OK, I have a web page like this...


    ================
    | DIV Header |
    ================
    ===== ===========
    |Menu|| CONTENT |
    ===== ===========


    Is there a way of only updating the content part, without refreashing the page.
    IE, if I select a menu item, the content part will change, so that i could have a php file called contents that shows different modules depending on what menu item is selected?

    I hope yous understand what i mean... Im sooo new to this.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,719
    Thanks
    25
    Thanked 662 Times in 661 Posts
    This might help
    Code:
    <html>
    <body>
    
    <iframe src="test.html" width="600px;" height="300px;" style="float:right;">
      <p>Your browser does not support iframes.</p>
    </iframe>
    
    </body>
    </html>
    
    </body>
    </html>

  • Users who have thanked sunfighter for this post:

    seminaljim (10-30-2011)

  • #3
    New Coder
    Join Date
    Oct 2011
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts
    OK, cool... thanks... how to i dynamically change it thought, can i bind an event to it so that the iframe chages its contents?

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,719
    Thanks
    25
    Thanked 662 Times in 661 Posts
    Thought you were going to do this with the menu section?

    And a warning = It is up to the browser as to wither iframes works. I use FF and have it so everything opens in a new tab and I think most people do this. So it may be better to use AJAX to do this.
    But here is the iframe way:

    Code:
    <html>
    <body>
    
    <a href="http://www.yahoo.com" target="here">YAHOO</a>
    
    <iframe src="test_2.html" width="600px;" height="300px;" name="here" style="float:right;">
      <p>Your browser does not support iframes.</p>
    </iframe>
    
    </body>
    </html>


  •  

    Tags for this Thread

    Posting Permissions

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