Aqui te dejo un ejemplo
pagina.html Código HTML:
<html>
<head>
<script>
function llamarASP() {
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest(); // Firefox, Safari, ...
}
else
if (window.ActiveXObject) {
xhr = new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer
}
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) alert(xhr.responseText);
}
xhr.open('GET', 'ajax.asp', true);
xhr.send(null);
}
</script>
</head>
<body>
<input type="button" value="AJAX" onclick="llamarASP()">
</body>
</html>
ajax.asp
Código:
<%
response.write "Esto es AJAX"
%>