javascript xmlhttp parameters

S

sean

/////////////////////
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "http://somesite/logon.asp", false, "domain\username",
"password");
xmlhttp.send();
////////////////////

got an error, javascript error: Incorect syntax.

If I put:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "http://somesite/logon.asp", false);
xmlhttp.send();

Everything is fine but my goal is to pass windows authentication.
What's wrong with the 1st statement?
Thnx,
J
 
M

Martin Honnen

sean said:
/////////////////////
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "http://somesite/logon.asp", false, "domain\username",
"password");
xmlhttp.send();
////////////////////

got an error, javascript error: Incorect syntax.

I think the error is in the string literal passed in as the fourth
argument, you need to escape the backslash e.g. use
"domain\\username"
 
S

sean

Thank you Martin, though I tried what you have suggested but same
result, same error.
If I only take out the password from the parameters, I dont get the
error but of course the authentication box pops up - thats not my
goal.

Any other ideeas?
Thank you,

J
 
M

Martin Honnen

sean said:
though I tried what you have suggested but same
result, same error.

If you really get a syntax error then I think you have got the syntax
wrong. I have corrected one error, maybe there are others, can you post
the code you are using that causes the error, identifying the line that
IE claims causes the error?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top