1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
<html>
<head>
<script type="text/javascript">
//create the Cross-browser XMLHttpRequest object
function getFile(pURL) {
if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=postFileReady;
xmlhttp.open("GET", pURL, true); // leave true for Gecko
xmlhttp.send(null);
} else if (window.ActiveXObject) { //IE
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
if (xmlhttp) {
xmlhttp.onreadystatechange=postFileReady;
xmlhttp.open('GET', pURL, true);
xmlhttp.send();
}
} else {
alert('Your browser does not support the remote scripting object.');
}
}
// function to handle asynchronus call
function postFileReady() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200) {
//loadResults(xmlhttp.responseText);
document.getElementById('theExample').innerHTML=xmlhttp.responseText;
}
}
}
</script>
</head>
<body onload="getFile('http://www.rodsdot.com/ee/latin.htm');">
<div id="theExample">Loading...</div>
</body>
</html> |
Partager