initRTE('<script language="JavaScript"
src="http://www.somedomain.com/polls/xlaabsolute.asp?p=32"></script>',
'example.css');
The first parameter of the JavaScript function is generated using Classic
ASP, so this is just the example I am using since I can't figure out whats
wrong. When I open the page in my browser, I recieve the error "Unterminated
String Constant". If I select Yes when asked whether I want to debug using
Visual Studio 2008, Visual Studio 2008 highlights/underlines the following
section of the above code:
'<script language="JavaScript"
src="http://www.somedomain.com/polls/xlaabsolute.asp?p=32"><
When I hover over this section of highlighted code in Visual Studio 2008, it
says "Unterminated String Constant" as well. I will probably feel pretty
stupid once I see the answer, but can somebody tell me why the string is
considered unterminated? Thanks.
--
Nathan Sokalski
njsok...@hotmail.com
http://www.nathansokalski.com/
HTML parser doesn't understand JavaScript. When it encounters a <script>
tag, it looks through the rest of the text looking for </script>, takes
it as the closing tag, and passes everything in between to JavaScript
interpreter.
In your case, the </script> tag it finds happens to be inside a string
literal - but again, HTML parser doesn't know anything about JavaScript
or string literals.
A typical workaround goes something like this:
initRTE('<script language="JavaScript" src="',
'example.css">http://www.somedomain.com/polls/xlaabsolute.asp?p=32"></scr'
+ 'ipt>',
'example.css');
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
"Igor Tandetnik" <itand...@mvps.org> wrote in message
news:OzL1KI1K...@TK2MSFTNGP05.phx.gbl...
Nathan Sokalski wrote:
> That would be great, except for the fact that, as I mentioned in my
> original post, the first parameter of the function here is generated
> by a small piece of Classic ASP (the value is coming from a
> database). What I really need is to find a way to convert a value to
> a JavaScript String.
--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
"Bob Barrows" <reb0...@NOyahoo.SPAMcom> wrote in message
news:eG9EQG3K...@TK2MSFTNGP05.phx.gbl...