As we know IE8 will use new object for AJAX, below I am defining the new function for AJAX request, its helpful for me. May be for you also.........
function ajaxRequest(){
var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
if(window.XDomainRequest){// for ie8+
try{
return new XDomainRequest();
}
catch(e){
//suppress error
}
}
else if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
for (var i=0; i<activexmodes.length; i++){
try{
return new ActiveXObject(activexmodes[i])
}
catch(e){
//suppress error
}
}
}
else if (window.XMLHttpRequest) // if Mozilla, Safari etc
return new XMLHttpRequest()
else
return false
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment