Using the jQuery $.ajax() function
Got this from the server:
The jQuery Code START
<script type="text/javascript" src="./jquery-1.5.1.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax( {
type: "GET",
url: "message3.txt",
success: callback
});
});
function callback(data, status) {
$("div").text(data);
$("#div2").text(data);
}
</script>
<style type="text/CSS">
<!--
.code { color: red; }
.back { background-color: yellow; }
-->
</style>
</head>
<body>
<h1>Using the jQuery $.ajax() function</h1>
Got this from the server: <div></div>
<div id="div2"></div>