This is my first attempt at AJAX, and so I'm keeping it simple. I've got a text file details.txt in the same folder as the index.html page.
The javascript I've got is as follows:
<script language="JavaScript" type="text/javascript">
function getInfoFromServer() {
$.get('details.txt', function(data) {
$('#AJAXtest').html(data);
});
}
</script>
And I'm calling that from a link as follows:
<a href="#" onClick="return false" onmousedown="javascript:getInfoFromServer()">Link</a>
And there's a div sitting nearby:
<div id="AJAXtest"></div>
The content of details.txt are:
test
I can't get this simple thing to work. Can anyone tell me what I'm doing wrong?