Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2811
  • Last Modified:

Unterminated string constant error

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
shalitd
Asked:
shalitd
  • 2
1 Solution
 
_nn_Commented:
It would be easier to "see" it directly on the site itself. URL ?
0
 
_nn_Commented:
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
 
evrcoolCommented:
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
 
CuSo4Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now