Pull DIV from separate page and update DIV in current page

Posted by brhea on Stack Overflow See other posts from Stack Overflow or by brhea
Published on 2011-01-09T18:49:38Z Indexed on 2011/01/09 18:53 UTC
Read the original article Hit count: 181

Filed under:

Hi everyone, I've got a simple one but haven't been able to find an example of a solution that fits exactly what I'm asking. Sorry in advance if this is a repeat.

From my navigation menu, I want each link to reference a specific DIV in a separate page and then pull that DIV and replace the content in the current page.

<ul>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
..and so on
</ul>

Elsewhere in the page:

<div id="displayContent">Content refreshes onClick. Previous content fades out, fresh content fades in.</div>

Separate page (content.php):

<div id="about">About content</div>
<div id="contact">Contact content</div>

© Stack Overflow or respective owner

Related posts about AJAX