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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -