Is there any way to check within JavaScript if XMLHttpRequest
object supports W3C Progress Events? I mean here if setting onload
, onprogress
Have you tried doing it this way?
try {
var xhr = new XMLHttpRequest();
if ('onprogress' in xhr) {
// Browser supports W3C Progress Events
} else {
// Browser does not support W3C Progress Events
}
} catch (e) {
// Browser is IE6 or 7
}
I tested this in Firefox & IE8. Firefox shows it supports it. IE says it has no support for W3C Progress events.