set initial content.

Discussion in 'PHP' started by maximum168, Jun 20, 2009.

  1. #1
    hello all,

    I am making a webpage. Simply speaking, there are 2 hyperlinks on the page, link A and link B.
    When i click on either link the content will be shown on the same page just below the link.

    How can i write the php to initially shown the content of link A when the page is loaded?


    Thank you very much.
     
    maximum168, Jun 20, 2009 IP
  2. JDevereux

    JDevereux Peon

    Messages:
    50
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use the onload event:

    <BODY onLoad="your_ajax_function_goes_here">
    Code (markup):
     
    JDevereux, Jun 20, 2009 IP
  3. HorseGalleria

    HorseGalleria Peon

    Messages:
    91
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It wouldn't be PHP, but javascript could do it depended were the data is coming from. You need to provide more details and post in the javascript forum. If you have the data in a hidden <div> you could change the display from none to inline or block for the id of the <div>. If you are using jquery, you could do:

    $('#id').show();
     
    HorseGalleria, Jun 21, 2009 IP