XMLHttpRequest - unterminated string constant javascript error

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

    XMLHttpRequest - unterminated string constant javascript error

    I have the following javascript function that updates a scroll_list and
    sends the updated entry (with its index) to a server script
    ( i.e. http://mkmxg00/cgi/confirmUpload.pl ) for further processing:

    function saveText( scroll_list, t_area, listToBeUpdated ) {
    scroll_list.opt ions[scroll_list.sel ectedIndex].text = t_area.text;
    scroll_list.opt ions[scroll_list.sel ectedIndex].value= t_area.value;

    var req;
    var url = "http://mkmxg00/cgi/confirmUpload.p l";

    if ( window.XMLHttpR equest ) {
    try {
    req = new XMLHttpRequest( );
    }
    catch( e ) {
    req = false;
    }
    }
    else if ( window.ActiveXO bject ) {
    try {
    req = new ActiveXObject( "Msxml2.XMLHTTP " );
    }
    catch( e ) {
    try {
    req = new ActiveXObject( "Microsoft.XMLH TTP" );
    }
    catch( e ) {
    req = false;
    }
    }
    if ( req ) {
    req.onreadystat echange = processReqChang e;
    req.open( "POST", url, true );

    // req.send( null );

    req.send( "client side" );
    req.send( "2nd piece of data from client side: " + i + "\n" );
    }
    }
    }

    function processReqChang e() {
    alert( req.readyState );
    if ( req.readyState == 4 ) {
    if ( req.status == 200 ) {
    // process the response if successful
    alert( "passed!" );
    }
    }
    else {
    alert( req.readyState + ", " + req.status );
    }
    }


    I tried the following reference:
    www.XML.com,Textuality Services,Drew McLellan,Instruction, Ajax,Very Dynamic Web Interfaces


    My questions:
    1) what caused the "unterminat ed string constant error"? I don't see any
    ', \r, etc in my javascript variables.

    2) If I want to send() to the server the scroll_list option, and that
    option's index to the server script http://mkmxg00/cgi/confirmUpload.pl
    for further processing, am I using send() correctly? If not, please
    correct by providing an example.



  • Thomas 'PointedEars' Lahn

    #2
    Re: XMLHttpRequest - unterminated string constant javascript error

    William wrote:
    [color=blue]
    > [...]
    > if ( req ) {
    > req.onreadystat echange = processReqChang e;
    > req.open( "POST", url, true );[/color]

    XMLHttpRequest. prototype.open( ) is described to clear all event listeners,
    so you should switch the order of the last two statements.

    <URL:http://xulplanet.com/references/objref/XMLHttpRequest. html#method_ope n>
    [color=blue]
    > // req.send( null );
    >
    > req.send( "client side" );
    > req.send( "2nd piece of data from client side: " + i + "\n"
    > );
    > }
    > [...]
    > I tried the following reference:
    > http://www.xml.com/pub/a/2005/02/09/...p-request.html[/color]

    You better look at the source: see

    <URL:http://msdn.microsoft. com/library/en-us/xmlsdk/html/7924f6be-c035-411f-acd2-79de7a711b38.as p>

    and the URI above.
    [color=blue]
    > My questions:
    > 1) what caused the "unterminat ed string constant error"? I don't see any
    > ', \r, etc in my javascript variables.[/color]

    The code you posted is syntactically correct. The error must be elsewhere.
    Since you did not post how you call the saveText() method, it is possible
    that the method call creates the problem.

    <URL:http://jibbering.com/faq/#FAQ4_43>
    [color=blue]
    > 2) If I want to send() to the server the scroll_list option, and that
    > option's index to the server script http://mkmxg00/cgi/confirmUpload.pl
    > for further processing, am I using send() correctly?[/color]

    No. It does not make sense to make several independent asynchronous POST
    requests to the same resource without changing the event listener. You
    should get informed about HTTP; read RFC1945 and RFC2616.
    [color=blue]
    > If not, please correct by providing an example.[/color]

    req.send(
    "client side"
    + "2nd piece of data from client side: " + i + "\n");

    BTW: This is the fourth thread started by you dealing with the same main
    problem. I would appreciate it -- and I am sure I am not the only one here
    -- if you would not start a new thread unless the main problem to be solved
    changes significantly; instead please continue the existing thread (post a
    followup). RT[fp]ineM or use a newsreader application that you can handle
    instead.


    PointedEars

    Comment

    • William

      #3
      Re: XMLHttpRequest - unterminated string constant javascript error

      On Tue, 24 Jan 2006, Thomas 'PointedEars' Lahn wrote:
      [color=blue]
      > William wrote:
      >[color=green]
      >> [...]
      >> if ( req ) {
      >> req.onreadystat echange = processReqChang e;
      >> req.open( "POST", url, true );[/color]
      >
      > XMLHttpRequest. prototype.open( ) is described to clear all event listeners,
      > so you should switch the order of the last two statements.[/color]

      I switched the order of the last 2 statements. Unfortunately I got the
      same error.
      [color=blue]
      >
      > <URL:http://xulplanet.com/references/objref/XMLHttpRequest. html#method_ope n>
      >[color=green]
      >> // req.send( null );
      >>
      >> req.send( "client side" );
      >> req.send( "2nd piece of data from client side: " + i + "\n"
      >> );
      >> }
      >> [...]
      >> I tried the following reference:
      >> http://www.xml.com/pub/a/2005/02/09/...p-request.html[/color]
      >
      > You better look at the source: see
      >
      > <URL:http://msdn.microsoft. com/library/en-us/xmlsdk/html/7924f6be-c035-411f-acd2-79de7a711b38.as p>
      >
      > and the URI above.[/color]

      i have already read this MSDN reference before posting.
      [color=blue][color=green]
      >> My questions:
      >> 1) what caused the "unterminat ed string constant error"? I don't see any
      >> ', \r, etc in my javascript variables.[/color]
      >
      > The code you posted is syntactically correct. The error must be elsewhere.
      > Since you did not post how you call the saveText() method, it is possible
      > that the method call creates the problem.[/color]

      saveText() was called in the following 2 places:

      print $query->td(
      $query->textarea(-name=>'BOFOTick ers'),
      $query->p,
      $query->button(-name=>'ADD',
      -value=>'Confirm Modifications',
      -onClick=>"saveT ext( this.form.bo_fo _tickers,
      this.form.BOFOT ickers, this.form.bo_fo _tickers )"),
      $query->button(-name=>'REMOVE',
      -value=>'Edit Selected Entry',
      -onClick=>"edit( this.form.bo_fo _tickers,
      this.form.BOFOT ickers)"));

      print $query->td(
      $query->textarea(-name=>'BOFOEmai ls'),
      $query->p,
      $query->button(-name=>'ADD',
      -value=>'Confirm Modifications',
      -onClick=>"saveT ext( this.form.bo_fo _emails,
      this.form.BOFOE mails, this.form.bo_fo _emails )"),
      $query->button(-name=>'REMOVE',
      -value=>'Edit Selected Entry',
      -onClick=>"edit( this.form.bo_fo _emails,
      this.form.BOFOE mails)"));
      [color=blue]
      > <URL:http://jibbering.com/faq/#FAQ4_43>[/color]
      also read this URL before posting; but the line number and character given
      in the javascript error message is wrong - it refers to an unrelated place
      in my source code file.

      The error is intermittent - sometimes even when the page loads up, I got
      the same javascript unterminated string constant error.


      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: XMLHttpRequest - unterminated string constant javascript error

        William wrote:
        [color=blue]
        > On Tue, 24 Jan 2006, Thomas 'PointedEars' Lahn wrote:[color=green]
        >> William wrote:[color=darkred]
        >>> [...]
        >>> if ( req ) {
        >>> req.onreadystat echange = processReqChang e;
        >>> req.open( "POST", url, true );[/color]
        >>
        >> XMLHttpRequest. prototype.open( ) is described to clear all event
        >> listeners, so you should switch the order of the last two statements.[/color]
        >
        > I switched the order of the last 2 statements. Unfortunately I got the
        > same error.[/color]

        It was a Good Thing anyway.
        [color=blue][color=green]
        >> [...][color=darkred]
        >>> My questions:
        >>> 1) what caused the "unterminat ed string constant error"? I don't see
        >>> any ', \r, etc in my javascript variables.[/color]
        >>
        >> The code you posted is syntactically correct. The error must be
        >> elsewhere. Since you did not post how you call the saveText() method, it
        >> is possible that the method call creates the problem.[/color]
        >
        > saveText() was called in the following 2 places:
        >
        > [probably server-side code][/color]

        Whatever this is, it is not JS/ECMAScript. Post client-side code if you
        have a problem with client-side scripting, and post only JS/ECMAScript code
        here.
        [color=blue][color=green]
        >> <URL:http://jibbering.com/faq/#FAQ4_43>[/color]
        > also read this URL before posting; but the line number and character given
        > in the javascript error message is wrong - it refers to an unrelated place
        > in my source code file.[/color]

        Of course it is wrong. It is referring to the generated (client-side) code,
        not the generating (server-side) one.


        PointedEars

        Comment

        • William

          #5
          Re: XMLHttpRequest - unterminated string constant javascript error

          On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:

          [...]
          [color=blue][color=green][color=darkred]
          >>> <URL:http://jibbering.com/faq/#FAQ4_43>[/color]
          >> also read this URL before posting; but the line number and character given
          >> in the javascript error message is wrong - it refers to an unrelated place
          >> in my source code file.[/color]
          >
          > Of course it is wrong. It is referring to the generated (client-side) code,
          > not the generating (server-side) one.[/color]

          "unterminat ed string constant javascript error" occured on line 99,
          character 5.

          The client-side code would be the HTML page. But I tried view->source
          from my brower, and my HTML code has only 48 lines. So where is this
          "line 99, character 5" come from?

          Comment

          • Randy Webb

            #6
            Re: XMLHttpRequest - unterminated string constant javascript error

            William said the following on 1/25/2006 10:36 AM:[color=blue]
            > On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
            >
            > [...]
            >[color=green][color=darkred]
            >>>> <URL:http://jibbering.com/faq/#FAQ4_43>
            >>> also read this URL before posting; but the line number and character
            >>> given
            >>> in the javascript error message is wrong - it refers to an unrelated
            >>> place
            >>> in my source code file.[/color]
            >>
            >> Of course it is wrong. It is referring to the generated (client-side)
            >> code,
            >> not the generating (server-side) one.[/color]
            >
            > "unterminat ed string constant javascript error" occured on line 99,
            > character 5.
            >
            > The client-side code would be the HTML page. But I tried view->source
            > from my brower, and my HTML code has only 48 lines. So where is this
            > "line 99, character 5" come from?[/color]

            Do you have any external .css files or .js files referenced? Those lines
            of code will be included when counting line numbers. The same as if you
            had not used external files but pasted the contents into the HTML file.

            If not, then post a URL to a sample page that shows the error.

            --
            Randy
            comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
            Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

            Comment

            • William

              #7
              Re: XMLHttpRequest - unterminated string constant javascript error

              On Wed, 25 Jan 2006, Randy Webb wrote:
              [color=blue]
              > William said the following on 1/25/2006 10:36 AM:[color=green]
              >> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
              >>
              >> [...]
              >>[color=darkred]
              >>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
              >>>> also read this URL before posting; but the line number and character
              >>>> given
              >>>> in the javascript error message is wrong - it refers to an unrelated
              >>>> place
              >>>> in my source code file.
              >>>
              >>> Of course it is wrong. It is referring to the generated (client-side)
              >>> code,
              >>> not the generating (server-side) one.[/color]
              >>
              >> "unterminat ed string constant javascript error" occured on line 99,
              >> character 5.
              >>
              >> The client-side code would be the HTML page. But I tried view->source from
              >> my brower, and my HTML code has only 48 lines. So where is this "line 99,
              >> character 5" come from?[/color]
              >
              > Do you have any external .css files or .js files referenced? Those lines of
              > code will be included when counting line numbers. The same as if you had not
              > used external files but pasted the contents into the HTML file.[/color]

              No .css nor .js files referenced.
              [color=blue]
              > If not, then post a URL to a sample page that shows the error.[/color]




              Comment

              • Randy Webb

                #8
                Re: XMLHttpRequest - unterminated string constant javascript error

                William said the following on 1/25/2006 11:00 AM:[color=blue]
                > On Wed, 25 Jan 2006, Randy Webb wrote:
                >[color=green]
                >> William said the following on 1/25/2006 10:36 AM:[color=darkred]
                >>> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                >>>
                >>> [...]
                >>>
                >>>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
                >>>>> also read this URL before posting; but the line number and
                >>>>> character given
                >>>>> in the javascript error message is wrong - it refers to an
                >>>>> unrelated place
                >>>>> in my source code file.
                >>>>
                >>>> Of course it is wrong. It is referring to the generated
                >>>> (client-side) code,
                >>>> not the generating (server-side) one.
                >>>
                >>> "unterminat ed string constant javascript error" occured on line 99,
                >>> character 5.
                >>>
                >>> The client-side code would be the HTML page. But I tried
                >>> view->source from my brower, and my HTML code has only 48 lines. So
                >>> where is this "line 99, character 5" come from?[/color]
                >>
                >> Do you have any external .css files or .js files referenced? Those
                >> lines of code will be included when counting line numbers. The same as
                >> if you had not used external files but pasted the contents into the
                >> HTML file.[/color]
                >
                > No .css nor .js files referenced.
                >[color=green]
                >> If not, then post a URL to a sample page that shows the error.[/color]
                > http://mkmxg00/cgi/extra_desks_upload_list.pl[/color]

                I get a Page Not Found for that URL.

                --
                Randy
                comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: XMLHttpRequest - unterminated string constant javascript error

                  William wrote:
                  [color=blue]
                  > On Wed, 25 Jan 2006, Randy Webb wrote:[color=green]
                  >> William said the following on 1/25/2006 10:36 AM:[color=darkred]
                  >>> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                  >>>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
                  >>>>> also read this URL before posting; but the line number and character
                  >>>>> given in the javascript error message is wrong - it refers to an
                  >>>>> unrelated place in my source code file.
                  >>>> Of course it is wrong. It is referring to the generated (client-side)
                  >>>> code, not the generating (server-side) one.
                  >>> "unterminat ed string constant javascript error" occured on line 99,
                  >>> character 5.
                  >>> The client-side code would be the HTML page. But I tried view->source
                  >>> from my brower, and my HTML code has only 48 lines. So where is this
                  >>> "line 99, character 5" come from?[/color]
                  >> Do you have any external .css files or .js files referenced? Those lines
                  >> of code will be included when counting line numbers. The same as if you
                  >> had not used external files but pasted the contents into the HTML file.[/color]
                  >
                  > No .css nor .js files referenced.[/color]

                  Is the generated source code valid markup (<URL:http://validator.w3.or g/>)
                  Are there any other `link' or `script' elements in your client-side source
                  code? If yes, which ones? Which user agent(s) are you testing with (post
                  the name and version along with the value of navigator.userA gent)?
                  [color=blue][color=green]
                  >> If not, then post a URL to a sample page that shows the error.[/color]
                  >
                  > http://mkmxg00/cgi/extra_desks_upload_list.pl[/color]
                  ^^^^^^^
                  A _fully qualified_ domain name would have been helpful.


                  PointedEars

                  Comment

                  • William

                    #10
                    Re: XMLHttpRequest - unterminated string constant javascript error

                    On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                    [color=blue]
                    > William wrote:
                    >[color=green]
                    >> On Wed, 25 Jan 2006, Randy Webb wrote:[color=darkred]
                    >>> William said the following on 1/25/2006 10:36 AM:
                    >>>> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                    >>>>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
                    >>>>>> also read this URL before posting; but the line number and character
                    >>>>>> given in the javascript error message is wrong - it refers to an
                    >>>>>> unrelated place in my source code file.
                    >>>>> Of course it is wrong. It is referring to the generated (client-side)
                    >>>>> code, not the generating (server-side) one.
                    >>>> "unterminat ed string constant javascript error" occured on line 99,
                    >>>> character 5.
                    >>>> The client-side code would be the HTML page. But I tried view->source
                    >>>> from my brower, and my HTML code has only 48 lines. So where is this
                    >>>> "line 99, character 5" come from?
                    >>> Do you have any external .css files or .js files referenced? Those lines
                    >>> of code will be included when counting line numbers. The same as if you
                    >>> had not used external files but pasted the contents into the HTML file.[/color]
                    >>
                    >> No .css nor .js files referenced.[/color]
                    >
                    > Is the generated source code valid markup (<URL:http://validator.w3.or g/>)
                    > Are there any other `link' or `script' elements in your client-side source
                    > code? If yes, which ones? Which user agent(s) are you testing with (post
                    > the name and version along with the value of navigator.userA gent)?
                    >[color=green][color=darkred]
                    >>> If not, then post a URL to a sample page that shows the error.[/color]
                    >>
                    >> http://mkmxg00/cgi/extra_desks_upload_list.pl[/color]
                    > ^^^^^^^
                    > A _fully qualified_ domain name would have been helpful.[/color]




                    Comment

                    • William

                      #11
                      Re: XMLHttpRequest - unterminated string constant javascript error

                      On Wed, 25 Jan 2006, Randy Webb wrote:
                      [color=blue]
                      > William said the following on 1/25/2006 11:00 AM:[color=green]
                      >> On Wed, 25 Jan 2006, Randy Webb wrote:
                      >>[color=darkred]
                      >>> William said the following on 1/25/2006 10:36 AM:
                      >>>> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                      >>>>
                      >>>> [...]
                      >>>>
                      >>>>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
                      >>>>>> also read this URL before posting; but the line number and character
                      >>>>>> given
                      >>>>>> in the javascript error message is wrong - it refers to an unrelated
                      >>>>>> place
                      >>>>>> in my source code file.
                      >>>>>
                      >>>>> Of course it is wrong. It is referring to the generated (client-side)
                      >>>>> code,
                      >>>>> not the generating (server-side) one.
                      >>>>
                      >>>> "unterminat ed string constant javascript error" occured on line 99,
                      >>>> character 5.
                      >>>>
                      >>>> The client-side code would be the HTML page. But I tried view->source
                      >>>> from my brower, and my HTML code has only 48 lines. So where is this
                      >>>> "line 99, character 5" come from?
                      >>>
                      >>> Do you have any external .css files or .js files referenced? Those lines
                      >>> of code will be included when counting line numbers. The same as if you
                      >>> had not used external files but pasted the contents into the HTML file.[/color]
                      >>
                      >> No .css nor .js files referenced.
                      >>[color=darkred]
                      >>> If not, then post a URL to a sample page that shows the error.[/color]
                      >> http://mkmxg00/cgi/extra_desks_upload_list.pl[/color]
                      >
                      > I get a Page Not Found for that URL.[/color]

                      my bad. please try:


                      Comment

                      • Randy Webb

                        #12
                        Re: XMLHttpRequest - unterminated string constant javascript error

                        William said the following on 1/25/2006 11:48 AM:[color=blue]
                        > On Wed, 25 Jan 2006, Randy Webb wrote:
                        >[color=green]
                        >> William said the following on 1/25/2006 11:00 AM:[color=darkred]
                        >>> On Wed, 25 Jan 2006, Randy Webb wrote:
                        >>>
                        >>>> William said the following on 1/25/2006 10:36 AM:
                        >>>>> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                        >>>>>
                        >>>>> [...]
                        >>>>>
                        >>>>>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
                        >>>>>>> also read this URL before posting; but the line number and
                        >>>>>>> character given
                        >>>>>>> in the javascript error message is wrong - it refers to an
                        >>>>>>> unrelated place
                        >>>>>>> in my source code file.
                        >>>>>>
                        >>>>>> Of course it is wrong. It is referring to the generated
                        >>>>>> (client-side) code,
                        >>>>>> not the generating (server-side) one.
                        >>>>>
                        >>>>> "unterminat ed string constant javascript error" occured on line 99,
                        >>>>> character 5.
                        >>>>>
                        >>>>> The client-side code would be the HTML page. But I tried
                        >>>>> view->source from my brower, and my HTML code has only 48 lines.
                        >>>>> So where is this "line 99, character 5" come from?
                        >>>>
                        >>>> Do you have any external .css files or .js files referenced? Those
                        >>>> lines of code will be included when counting line numbers. The same
                        >>>> as if you had not used external files but pasted the contents into
                        >>>> the HTML file.
                        >>>
                        >>> No .css nor .js files referenced.
                        >>>
                        >>>> If not, then post a URL to a sample page that shows the error.
                        >>> http://mkmxg00/cgi/extra_desks_upload_list.pl[/color]
                        >>
                        >> I get a Page Not Found for that URL.[/color]
                        >
                        > my bad. please try:
                        > http://mkmxg00.cibg.tdbank.ca/cgi/ex...upload_list.pl
                        >[/color]

                        I still get a Page Not Found for that URL as well

                        --
                        Randy
                        comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                        Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

                        Comment

                        • Randy Webb

                          #13
                          Re: XMLHttpRequest - unterminated string constant javascript error

                          Thomas 'PointedEars' Lahn said the following on 1/25/2006 11:24 AM:[color=blue]
                          > Which user agent(s) are you testing with (post the name and
                          > version along with the value of navigator.userA gent)?[/color]


                          I don't see the wisdom in requesting the navigator.userA gent string when
                          it is widely known to be worthless for anything other than a place holder.

                          Browser name and version tells you more than the userAgent string could
                          ever be good for.

                          --
                          Randy
                          comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                          Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

                          Comment

                          • Randy Webb

                            #14
                            Re: XMLHttpRequest - unterminated string constant javascript error

                            Randy Webb said the following on 1/25/2006 12:00 PM:[color=blue]
                            > William said the following on 1/25/2006 11:48 AM:[color=green]
                            >> On Wed, 25 Jan 2006, Randy Webb wrote:
                            >>[color=darkred]
                            >>> William said the following on 1/25/2006 11:00 AM:
                            >>>> On Wed, 25 Jan 2006, Randy Webb wrote:
                            >>>>
                            >>>>> William said the following on 1/25/2006 10:36 AM:
                            >>>>>> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                            >>>>>>
                            >>>>>> [...]
                            >>>>>>
                            >>>>>>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
                            >>>>>>>> also read this URL before posting; but the line number and
                            >>>>>>>> character given
                            >>>>>>>> in the javascript error message is wrong - it refers to an
                            >>>>>>>> unrelated place
                            >>>>>>>> in my source code file.
                            >>>>>>>
                            >>>>>>> Of course it is wrong. It is referring to the generated
                            >>>>>>> (client-side) code,
                            >>>>>>> not the generating (server-side) one.
                            >>>>>>
                            >>>>>> "unterminat ed string constant javascript error" occured on line
                            >>>>>> 99, character 5.
                            >>>>>>
                            >>>>>> The client-side code would be the HTML page. But I tried
                            >>>>>> view->source from my brower, and my HTML code has only 48 lines.
                            >>>>>> So where is this "line 99, character 5" come from?
                            >>>>>
                            >>>>> Do you have any external .css files or .js files referenced? Those
                            >>>>> lines of code will be included when counting line numbers. The same
                            >>>>> as if you had not used external files but pasted the contents into
                            >>>>> the HTML file.
                            >>>>
                            >>>> No .css nor .js files referenced.
                            >>>>
                            >>>>> If not, then post a URL to a sample page that shows the error.
                            >>>> http://mkmxg00/cgi/extra_desks_upload_list.pl
                            >>>
                            >>> I get a Page Not Found for that URL.[/color]
                            >>
                            >> my bad. please try:
                            >> http://mkmxg00.cibg.tdbank.ca/cgi/ex...upload_list.pl
                            >>[/color]
                            >
                            > I still get a Page Not Found for that URL as well
                            >[/color]

                            Have you tried testing the page in Mozilla? The error messages there
                            aren't as cryptic as IE Error Messages.

                            --
                            Randy
                            comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                            Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

                            Comment

                            • William

                              #15
                              Re: XMLHttpRequest - unterminated string constant javascript error

                              On Wed, 25 Jan 2006, Randy Webb wrote:
                              [color=blue]
                              > Randy Webb said the following on 1/25/2006 12:00 PM:[color=green]
                              >> William said the following on 1/25/2006 11:48 AM:[color=darkred]
                              >>> On Wed, 25 Jan 2006, Randy Webb wrote:
                              >>>
                              >>>> William said the following on 1/25/2006 11:00 AM:
                              >>>>> On Wed, 25 Jan 2006, Randy Webb wrote:
                              >>>>>
                              >>>>>> William said the following on 1/25/2006 10:36 AM:
                              >>>>>>> On Wed, 25 Jan 2006, Thomas 'PointedEars' Lahn wrote:
                              >>>>>>>
                              >>>>>>> [...]
                              >>>>>>>
                              >>>>>>>>>> <URL:http://jibbering.com/faq/#FAQ4_43>
                              >>>>>>>>> also read this URL before posting; but the line number and character
                              >>>>>>>>> given
                              >>>>>>>>> in the javascript error message is wrong - it refers to an unrelated
                              >>>>>>>>> place
                              >>>>>>>>> in my source code file.
                              >>>>>>>>
                              >>>>>>>> Of course it is wrong. It is referring to the generated
                              >>>>>>>> (client-side) code,
                              >>>>>>>> not the generating (server-side) one.
                              >>>>>>>
                              >>>>>>> "unterminat ed string constant javascript error" occured on line 99,
                              >>>>>>> character 5.
                              >>>>>>>
                              >>>>>>> The client-side code would be the HTML page. But I tried view->source
                              >>>>>>> from my brower, and my HTML code has only 48 lines. So where is this
                              >>>>>>> "line 99, character 5" come from?
                              >>>>>>
                              >>>>>> Do you have any external .css files or .js files referenced? Those
                              >>>>>> lines of code will be included when counting line numbers. The same as
                              >>>>>> if you had not used external files but pasted the contents into the
                              >>>>>> HTML file.
                              >>>>>
                              >>>>> No .css nor .js files referenced.
                              >>>>>
                              >>>>>> If not, then post a URL to a sample page that shows the error.
                              >>>>> http://mkmxg00/cgi/extra_desks_upload_list.pl
                              >>>>
                              >>>> I get a Page Not Found for that URL.
                              >>>
                              >>> my bad. please try:
                              >>> http://mkmxg00.cibg.tdbank.ca/cgi/ex...upload_list.pl
                              >>>[/color]
                              >>
                              >> I still get a Page Not Found for that URL as well[/color][/color]
                              [color=blue][color=green]
                              >>[/color]
                              >
                              > Have you tried testing the page in Mozilla? The error messages there aren't
                              > as cryptic as IE Error Messages.[/color]

                              I don't get this javascript error in Firefox 1.0.7.
                              [color=blue]
                              >
                              > --
                              > Randy
                              > comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                              > Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
                              >[/color]

                              Comment

                              Working...