Ajax Reload Content

Discussion in 'JavaScript' started by Silver89, Nov 3, 2008.

  1. #1
    I need to get ajax so that when these links are clicked it reloads the php in the include.

    I'm not sure how to do this though.

    <ul id="catBack" class="closeCrossRem">
    
    <a href="/linkhere.php?category=Action">Action</a>
    <a href="/linkhere.php?category=Action">Action</a>
    <a href="/linkhere.php?category=Action">Action</a>
    
    </ul>
    HTML:
    Thanks
     
    Silver89, Nov 3, 2008 IP
  2. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What exactly do you want to do? What do you want to fetch and how do you want to display it in the document? Do you have a one div set aside where the result will appear, no matter which link is clicked?
     
    LogicFlux, Nov 3, 2008 IP
  3. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #3
    Yeh,

    I will have one div with a default, then if those links are clicked it does the query in the link and then displays the new results without refreshing the page.

    Abit like the featured, leaderboard, newest, etc on MostPlays.com homepage.
     
    Silver89, Nov 3, 2008 IP
  4. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #4
    How will you build the markup? You can create the markup on the server side with PHP and then send it back as the ajax response or you can just send the "raw" data back and then build the markup with javascript.

    Answer that and I'll try to give you a simple example.
     
    LogicFlux, Nov 3, 2008 IP
    Silver89 likes this.
  5. mob4u1

    mob4u1 Well-Known Member

    Messages:
    951
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    110
    #5
    looking for this?

    dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
     
    mob4u1, Nov 5, 2008 IP
  6. mob4u1

    mob4u1 Well-Known Member

    Messages:
    951
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    110
    #6
    Or this:

    dynamicdrive.com/dynamicindex17/ajaxcontent.htm
     
    mob4u1, Nov 5, 2008 IP
    Silver89 likes this.
  7. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #7
    Yes thats good
     
    Silver89, Nov 5, 2008 IP
    Agent_Dweeb likes this.