Re: XMLHttpRequest - unterminated string constant javascript error
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: XMLHttpRequest - unterminated string constant javascript error

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Wed Jan 25 2006 - 16:22:43 CET

William wrote:

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

It was a Good Thing anyway.
 
>> [...]
>>> My questions:
>>> 1) what caused the "unterminated string constant error"? I don't see
>>> any ', \r, etc in my javascript variables.
>>
>> 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.
>
> saveText() was called in the following 2 places:
>
> [probably server-side code]

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.

>> <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.
 

PointedEars
Received on Tue Feb 7 21:22:40 2006