Thread: Dynamically displaying html on same page?

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 Dynamically displaying html on same page? 
    Member Market Banned Market Banned

    Zee Best's Avatar
    Join Date
    Feb 2007
    Age
    29
    Posts
    3,036
    Thanks given
    24
    Thanks received
    210
    Rep Power
    1171
    Basically, im looking for the easiest way of doing the following;

    Code:
    <? include("page.php"); ?>
    On a page, however, i need to be able to change the page displayed via links.

    Is it possible and what's the easiest way of doing it?


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Nov 2008
    Posts
    1,017
    Thanks given
    21
    Thanks received
    32
    Rep Power
    161
    i believe there Frame or something like that
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    0x2B | ~0x2B


    Impulser's Avatar
    Join Date
    Jul 2006
    Posts
    1,305
    Thanks given
    389
    Thanks received
    335
    Rep Power
    2751
    <? include($_GET['page']) ?>

    :trollface::trollface::trollface:
    Reply With Quote  
     

  4. #4  
    Member Market Banned Market Banned

    Zee Best's Avatar
    Join Date
    Feb 2007
    Age
    29
    Posts
    3,036
    Thanks given
    24
    Thanks received
    210
    Rep Power
    1171
    Quote Originally Posted by Impulser View Post
    <? include($_GET['page']) ?>

    :trollface::trollface::trollface:
    Well, i want to do it without visibly changing the url.

    So, i was going to use $_POST but i didn't know how to create a link which would work with a form or anything.

    I also tried iframes since content updating on them is easy, however i could never get the height to adjust.


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Member Market Banned Market Banned

    Zee Best's Avatar
    Join Date
    Feb 2007
    Age
    29
    Posts
    3,036
    Thanks given
    24
    Thanks received
    210
    Rep Power
    1171
    Quote Originally Posted by ajjr1228 View Post
    Ajax.
    Feel free to give me a complete working example...


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. #6  
    ZammyPk25
    Guest
    Quote Originally Posted by +Null View Post
    i believe there Frame or something like that
    [Only registered and activated users can see links. ]
    No, get out. Frame isn't recommended.
    Reply With Quote  
     

  7. #7  
    Member Market Banned Market Banned

    Zee Best's Avatar
    Join Date
    Feb 2007
    Age
    29
    Posts
    3,036
    Thanks given
    24
    Thanks received
    210
    Rep Power
    1171
    Quote Originally Posted by ajjr1228 View Post
    Teach yourself. How I learned how to do PHP.

    OH LOOK FIRST RESULT ON GOOGLE..

    [Only registered and activated users can see links. ]

    OH LOOK SOMEMORE!

    [Only registered and activated users can see links. ]
    Both of which use the URL to change, for example; page.php#page

    Which is what i said i didn't want to happen.


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jan 2011
    Posts
    2
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Zee Best View Post
    Both of which use the URL to change, for example; page.php#page

    Which is what i said i didn't want to happen.
    No they do not Look closely at the example . It refreshes the page with that displayed page.. not using the URL whatsoever
    Reply With Quote  
     

  9. #9  
    Member Market Banned Market Banned

    Zee Best's Avatar
    Join Date
    Feb 2007
    Age
    29
    Posts
    3,036
    Thanks given
    24
    Thanks received
    210
    Rep Power
    1171
    Quote Originally Posted by Lil E 420 View Post
    No they do not Look closely at the example . It refreshes the page with that displayed page.. not using the URL whatsoever
    I have looked, and click demo on the second one, or the source, uses #pagename at the end of the url to show that content.


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    Registered Member thiefmn6092's Avatar
    Join Date
    Dec 2006
    Age
    21
    Posts
    2
    Thanks given
    26
    Thanks received
    389
    Rep Power
    0
    Code:
    <html>
    	<body>
    		<script type="javascript/text">
    			var a = new XMLHttpRequest( );
    			a.onreadystatechange = function( )
    			{
    				document.getElementById( "A" ).innerHTML = a.responseText;
    			}
    			a.open( "GET", "somefile.txt", true );
    			a.send( );
    		</script>
    		<div id="A">
    			The server hasn't processed your file request yet...
    		</div>
    	</body>
    </html>
    the readystatechange callback allows for you to hook the browser event for when the Javascript request is returned by the server...

    the open function allows you to control what the request type is, the page (or file) to GET and the true designates this request
    is asynchronous (meaning it will be processed by the browser in the background...

    document.getElementById allows you to return a Javascript object representing the divider element "A" which then gives us the
    ability to edit its "HTML", using the .innerHTML attribute...
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. My first html page [release]
    By xJames in forum Website Development
    Replies: 8
    Last Post: 01-25-2011, 01:04 AM
  2. [DOM] Dynamically creating new HTML elements
    By Anthony` in forum Website Development
    Replies: 5
    Last Post: 12-10-2010, 05:23 PM
  3. Second HTML page, still basic
    By Muroth in forum Website Development
    Replies: 10
    Last Post: 11-20-2010, 06:18 PM
  4. Display basic HTML page
    By Oxygen in forum Snippets
    Replies: 20
    Last Post: 07-17-2009, 08:26 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •