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
Post a Comment