有人可以帮我将下面的代码转换为 jQuery 吗?
var xmlhttp;
if (window.XMLHttpRequest)
{
// Code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else
{
// Code for IE5, IE6
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", "http://www.my.com", true);
xmlhttp.setRequestHeader("MyHeader", "hello");
xmlhttp.send();
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4)
{
document.getElementById("responseText").innerHTML = xmlhttp.responseText;
}
}
}