Re: unterminated string constant error
by "Srinivasan Ramakrishnan" <srinivar(at)md3.vsnl.net.in>
|
Date: |
Wed, 9 Feb 2000 19:21:43 +0530 |
To: |
"Cyanide _7" <leo7278(at)hotmail.com>, <Chucke(at)captura.com> |
Cc: |
<hwg-languages(at)hwg.org> |
References: |
hotmail |
|
todo: View
Thread,
Original
|
|
Hi,
Two things:
First:
The code is OK, you have split the string into two with a hard-coded CRLF.
This is your problem, I've checked it on IE5 & NN4.7, it works. Basically JS
strings can't contain a CRLF(#13#10)
Second:
My guess is it will work if done in ASP, since the ASP act is over by the
time your webserver is ready to do the preprocessing. Infact I remember
conditional SSI's being done in CFML.
Cheers,
-Srini
----- Original Message -----
From: Cyanide _7 <leo7278(at)hotmail.com>
To: <Chucke(at)captura.com>
Cc: <hwg-languages(at)hwg.org>
Sent: Wednesday, February 09, 2000 10:30 AM
Subject: RE: unterminated string constant error
| I don't think this is possible. other include statements that were
suggested
| (css, js) are client-side. i do believe <!--#include is server-side and
| cannot be done with js. by the same token, js cannot write asp. i wonder,
| however, if asp can write this being that both are server-side...hmmmm. -
| Cyanide_7
|
| >Thanks to everyone for their responses. I tried subsituting a variable
for
| >"<" as Stephen Thorin suggested, but that didn't work. I also checked the
| >carriage returns as Peter Newton suggested, but they were fine. Peter
| >Benoit
| >asked if I really could write an include statement with Javascript. I
still
| >don't know, but I do know you can write other "include" type statements,
| >such as CSS and javascript file links.
|
|
|
| >
| >I decided to go to using ASP for the form, since I'm on an IIS server
(not
| >my choice of server). In this way, I can set a variable in the link to
the
| >form (eg, www.mysite.com/myform.asp?formtype=info) and then use Case to
| >display the correct include statement like this:
| >
| ><%
| >Select Case Request("formtype")
| >Case "info" %>
| ><!--#include virtual='/includes/include1.html'-->
| ><% Case "ui_reg" %>
| ><!--#include virtual='/includes/include2.html'-->
| ><% Case Else %>
| ><!--#include virtual='/includes/include1.html'-->
| ><%
| >End Select
| >%>
| >
| >This is also working in the remainder of the form to customize headings
and
| >explanatory text. So I'm happy, I guess.
| >
| >---------------------------------------------------------
| >Chuck Evans
| >Web Marketing Manager
| >Captura Software, Inc.
| >(425) 424-1155
| >chucke(at)captura.com
| >www.captura.com
| >
| > > -----Original Message-----
| > > > From: Chuck Evans [SMTP:Chucke(at)captura.com]
| > > >
| > > > I have the following javascript (shown below). In every case, when I
| >try
| > > > to
| > > > run it, I get an error "Line 26, Char 68, Unterminated string
| >constant".
| > > > That indicates the character "a" in the word "virtual" in the very
| >first
| > > > if/then statement. If I've coded the script right (which I obviously
| > > > haven't) then it should be executing the second if/then, not the
| >first.
| > > > I have tried every combination of double and single quotes on the
| >string
| > > > to be written but can't get past this error.
|
| ______________________________________________________
| Get Your Private, Free Email at http://www.hotmail.com
|
|
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA