Problems with XMLHttpRequest.send in Firefox 3

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Problems with XMLHttpRequest.send in Firefox 3

With the 3.0 version, I've been having some problems with a javascript
function. This code worked just fine in Firefox 2.0, and still works
fine in Internet Explorer. Any thoughts?

Here's the script
function login(uname, pwd) {
 var objHTTP;
 if (window.ActiveXObject) {
  objHTTP = new ActiveXObject('Microsoft.XMLHTTP');
 else {
  objHTTP = new XMLHttpRequest();
 objHTTP.setRequestHeader('Content-Type', 'application/x-www-form-
 objHTTP.send("un=" + uname + "&pw=" + pwd);
 var strResult = objHTTP.responseText;
 var regexp = /url="(.*)">/;
 var url = regexp.exec(strResult)[1];
 window.open('/cgi-bin/' + url);

It chokes at the line "var strResult = objHTTP.responseText;" because
it seems that the previous line did not correctly send the username
and password. Does anyone have an idea about why this is happening? I
thought about the encoding problem that was discussed last month here,
but I don't think that's the problem.
dev-i18n mailing list
[hidden email]