Load a file into inner webpage is done by jquery. So that no refresh required the whole page or no need to re-loading the whole page. It save the time to access data. This techniques code is given below.
Load a file in inner div tab using jquery
<html>
</head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<style type="text/css">
#btnload{
cursor:pointer;
padding:10px;
background:#FB9644;
width:200px;
margin-bottom:10px;
}
#content{
padding:10px;
background:#FB9644;
width:600px;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("#btnload").click(function(){
$("#content").html('<img src="ajax-loader.gif" />');
$("#content").load("load-div1.html");
});
});
</script>
</head>
<body>
<div id="btnload">Click</div>
<div id="content"></div>
</body>

No comments:
Post a Comment