call a page using javascript

Discussion in 'JavaScript' started by kites2010, Jun 27, 2010.

  1. #1
    I want to give a URL( http://prithvitheatre.org/home.php) which when clicked on the top menu items (like about us, what's on) loads a different page in the same URL as above. e.g. clicking on the what's on button loads the whats_on.php page but on the /home.php URL. How to do this?
     
    kites2010, Jun 27, 2010 IP
  2. Kaimi

    Kaimi Peon

    Messages:
    60
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Kaimi, Jun 27, 2010 IP
  3. kites2010

    kites2010 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    they are not using ajax to do this. plz refer to the URL.
     
    kites2010, Jun 27, 2010 IP
  4. bvraghav

    bvraghav Member

    Messages:
    123
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #4
    this was done by php programming and not javascript...

    while on page, they call on to submit a form

    function call_page(page) {	
    	document.forms[0].page_name.value=page ;
    	document.forms[0].submit() ;
    }
    
    Code (markup):
    which essentially triggers the submit of this form
    <form action="home.php" method=post name=frm_page>
    	<INPUT TYPE="hidden" NAME="page_name" value=''>
    </form>
    
    HTML:
    if the method would have been get, you would have seen the url something like this
    http :// prithvitheatre.org / home.php ? page_name=whats_on.php

    if you look at the http://prithvitheatre.org/whats_on.php, you will find that it actually has some content for the page (though the url that shows up is still home.php).

    hope, you get the idea...

    personally, I would have preferred ajax...
     
    bvraghav, Jun 28, 2010 IP
  5. kites2010

    kites2010 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks.. got it
     
    kites2010, Jun 28, 2010 IP