javascript - using a tag to replace div -
my site has 2 pages both have hyperlinks each other when user click on hyperlink need div of page replaced div on other page, please guide me how program it.
structure
page1.html
<div id="no_replace"> <a href="page2.html">page 2</a> <div id="replace"> //page 1 stuff </div> </div>
page2.html
<div id="no_replace"> <a href="page1.html">page 1</a> <div id="replace"> //page 2 stuff </div> </div>
so on page 1 when usr clicks on link "page two" ... want 'replace' div of page 1 replaced 'replace' div of page2.html , there should fade in , fadeout
use load() method.
$('a').click(function(){ $('div').load($(this).attr('href')); });
Comments
Post a Comment