<html>
<head>
<script type="text/javascript">
function getXhr(){
var xhr = null;
if(window.XMLHttpRequest){
xhr = new XMLHttpRequest();
}else{
xhr = new ActiveXObject("Microsoft.XMLHttp");
}
return xhr;
}
</script>
</head>
<body style="font-size:30px;">
<a href="javascript:alert(getXhr());">ClickMe</a>
</body>
</html>