<!Doctype html>
<html>
<head>
<title>xhr test</title>
<script src="xhr.js" type="text/javascript"></script>
<script>
function showtext()
{
a$.xhr("xhr.js", function() {
document.getElementById('asi').innerHTML =
"<pre>"+resp+"</pre>";
});
}
function showimage()
{
a$.xhr("xhr.js", {callback:function() {
document.getElementById('asi').innerHTML =
"<pre>"+resp+"</pre>";
},
async: true,
method: "get"});
}
</script>
</head>
<body>
<section>
<input type="button" value="Load JS code" onclick="showtext();" />
<div id="sst"></div>
<input type="button" value="Load Image" onclick="showimage();" />
<div id="asi" style="height:170px;overflow:scroll;"></div>
</section>
</body>
</html> |