Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant stop error 12152

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Everytime I make an AJAX call I am getting a return code of 12152.

I've found a few threads talking about it to do with SSL , however I have another AJAX script working fine on SSL on the same server, so now i'm thinking it's a windows user account issue.

The script is located on an area that has a windows username / password protection, now i've already navigated to the form and it's asked me for these login details, so the browser has been authenticated.

So am I to assume that the browser issuing an AJAX request isn't passing the authentication the server requires to validate the browser session is logged in?

If this is the problem, is there a way round it?

Thanks,
1DMF.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Found the answer, typical 'cargo-cult' programing came bit me on the ass!!!

I had used some AJAX code from an example page, and until now it had served me well.

But there was a line here.....
Code:
http_request.setRequestHeader("Connection", "close");

I always assumed this was just closing the header statements prior to the send request ...
Code:
http_request.open('POST', url, true);
      http_request.onreadystatechange = alertContents;
      http_request.setRequestHeader("Content-type", "application/x-[URL unfurl="true"]www-form-urlencoded");[/URL]
      http_request.setRequestHeader("Content-length", parameters.length);
      //http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);

But as soon as I commented out the requestHeader(close), it works fine!

Phew, now I can get on with developing!


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top