javascript xmlhttp parameters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sean

    javascript xmlhttp parameters

    /////////////////////
    var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
    xmlhttp.open("P OST", "http://somesite/logon.asp", false, "domain\usernam e",
    "password") ;
    xmlhttp.send();
    ////////////////////

    got an error, javascript error: Incorect syntax.

    If I put:
    var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
    xmlhttp.open("P OST", "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
  • Martin Honnen

    #2
    Re: javascript xmlhttp parameters



    sean wrote:
    [color=blue]
    > /////////////////////
    > var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
    > xmlhttp.open("P OST", "http://somesite/logon.asp", false, "domain\usernam e",
    > "password") ;
    > xmlhttp.send();
    > ////////////////////
    >
    > got an error, javascript error: Incorect syntax.[/color]

    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\\userna me"

    --

    Martin Honnen

    Comment

    • sean

      #3
      Re: javascript xmlhttp parameters

      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

      Martin Honnen <mahotrash@yaho o.de> wrote in message news:<41518864$ 0$18551$9b4e6d9 3@newsread2.arc or-online.net>...[color=blue]
      > sean wrote:
      >[color=green]
      > > /////////////////////
      > > var xmlhttp = new ActiveXObject(" Microsoft.XMLHT TP");
      > > xmlhttp.open("P OST", "http://somesite/logon.asp", false, "domain\usernam e",
      > > "password") ;
      > > xmlhttp.send();
      > > ////////////////////
      > >
      > > got an error, javascript error: Incorect syntax.[/color]
      >
      > 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\\userna me"[/color]

      Comment

      • Martin Honnen

        #4
        Re: javascript xmlhttp parameters



        sean wrote:
        [color=blue]
        > though I tried what you have suggested but same
        > result, same error.[/color]

        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?


        --

        Martin Honnen

        Comment

        Working...