Tue Jan 01, 2013 3:27 pm
<html>
<head>
<title>Get File using AJAX under JQuery</title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
$("button#b1").click(function(){
$("div#d1").load("smallTable.html",function(responseTxt,statusTxt,xhr){
if(statusTxt=="success")
alert("New content loaded successfully!");
if(statusTxt=="error")
alert("Error: "+xhr.status+": status:"+xhr.statusText);
});
});
});
</script>
</head>
<body>
<div id="d1" >This Text is inside the Div</div>
<br>
<button id="b1">Load HTML File</button>
</body>
</html>
<table>
<tr>
<td>
Account 1
</td>
<td>
Account 2
</td>
</tr>
<tr>
<td>
543USD
</td>
<td>
433USD
</td>
</tr>
</table>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.