Solved

Unterminated string constant error

Posted on 2003-10-30
4
2,787 Views
Last Modified: 2007-12-19
Every time i open the web site i have created i get the following java script error message :
Unterminated string constant error

this is the realted line :
NWA=window.open("http://freehostingad.domaindlx.com","PON","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0 width=300,height=45")

What is the problem ?
0
Comment
Question by:shalitd
  • 2
4 Comments
 
LVL 16

Expert Comment

by:_nn_
ID: 9652962
It would be easier to "see" it directly on the site itself. URL ?
0
 
LVL 16

Expert Comment

by:_nn_
ID: 9653002
There's a comma missing between "resizable=0" and "width=300", but even so, the line you pasted is just fine (no javascript errors). So I guess the problem comes from the lines before that one.
0
 
LVL 3

Expert Comment

by:evrcool
ID: 9654919
I agree with _nn_. Usually, this is due to a hard return in the middle of a line. For instance, in what I'm looking at above I see

("http://freehostingad.domaindlx.com","PON","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0

on one line and

width=300,height=45")

on another. This will cause that exact error if that is how it really looks in your code.

Also, check any other JavaScript that comes before this to ensure that all the Quotes are correct.

0
 
LVL 2

Accepted Solution

by:
CuSo4 earned 100 total points
ID: 9658411
You have to make a difference in your code between ASP(.NET)-code and Javascript code. I would replace all double quotes (") that have something to do with Javascript by single quotes ('). In Javascript this means the same thing, and if you do it that way the compiler will easily see the difference between JavaScript and .NET code. So the line you gived would be:

NWA=window.open('http://freehostingad.domaindlx.com','PON','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=45')

Just as an exemple, if NWA is a String Variable in your Code-Behind, the VB-code will look like this:

Dim NWA As String
NWA = _ "window.open('http://freehostingad.domaindlx.com','PON','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=45')"
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Order table with macro 3 75
c# combobox autocomplete behavior 6 92
Specific format 21 140
topping2 challenge 13 58
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now