R
Ronald Green
Hi all,
I'm trying to write a js function that uses XMLHttpRequest against a
web application.
Sometimes I get a 302, and the XMLHttpRequest automatically
redirects.
What I want to accomplish is either:
1. Don't let it redirect but figure out that it wanted to, and get the
'location' response header.
2. Let it redirect, but know the URL I was redirected to.
The javascript is running on Internet Explorer 6.
I'm not using any library. I just add tiny fragments of js in order to
enhance an existing web application. I'm using this crossplatform
function to get an xmlhttprequest object:
function getHTTPObject()
{
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
}
Thanks in advance,
R. Green
I'm trying to write a js function that uses XMLHttpRequest against a
web application.
Sometimes I get a 302, and the XMLHttpRequest automatically
redirects.
What I want to accomplish is either:
1. Don't let it redirect but figure out that it wanted to, and get the
'location' response header.
2. Let it redirect, but know the URL I was redirected to.
The javascript is running on Internet Explorer 6.
I'm not using any library. I just add tiny fragments of js in order to
enhance an existing web application. I'm using this crossplatform
function to get an xmlhttprequest object:
function getHTTPObject()
{
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
}
Thanks in advance,
R. Green