<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#b01").click(function(){
htmlobj = $.ajax({type:"GET", url:"http://xxxx/handset/handsetapi?catalogId=1", dataType:"xml", timeout:3000, cache:true,
beforeSend:function (XMLHttpRequest) {
alert(XMLHttpRequest.readyState);
XMLHttpRequest.setRequestHeader("Client-Agent", "xxxx");
XMLHttpRequest.setRequestHeader("Cookie", "xxxx");
XMLHttpRequest.setRequestHeader("Action", "getxxxxe");
// XMLHttpRequest.setRequestHeader("user-id", "");
// XMLHttpRequest.setRequestHeader("Content-Type", "application/xml");
XMLHttpRequest.setRequestHeader("APIVersion", "1.0.0");
XMLHttpRequest.setRequestHeader("x-up-calling-line-id", "xxxx");
},
success:function (data, textStatus) {
alert("X: 1");
}
});
$("#myDiv").html(htmlobj.responseText);
});
});
</script>
</head>
<body>
<div id="myDiv"><h2>Let XXX AJAX change this text</h2></div>
<button id="b01" type="button">Change Content</button>
</body>
</html>