javascript - load html link into div -


i have list of links in div...when click on link want load link content in div in same page, here code :

<div>  <div>     <div style="padding-bottom:20px;">        <center><img src="real.gif"></center>     </div>     <div>        <div>             <div style="padding-bottom:20px;">                 <a href="history.html"><h3>history of club</h3></a>             </div>             <div style="padding-bottom:20px;">                 <a href=""><h3>photos gallery</h3></a>             </div>             <div style="padding-bottom:20px;">                 <a href=""><h3>hall of fame</h3></a>             </div>             <div style="padding-bottom:20px;">                 <a href=""><h3>history of club</h3></a>             </div>       </div>   </div> </div> <div id="linkcontent"></div> 

can simple js function ? suggestions?

use ajax, recormend jquery ajax, update div.

something like:

     $("#mylink").click (function () {         $.ajax({            type: "post", // or            url: "mylink.php",//what ever link want load            data: "somedata=something&somemore=somethingelse",            success: function(data){                   $("#someelement").dosomething().           }      });      return false;      }); 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -