?
Solved

Unterminated String Constant error

Posted on 2003-03-20
9
Medium Priority
?
505 Views
Last Modified: 2007-12-19
Hi,

I have the following line of codes that produced the 'Unterminated String Constant' error.  Can't figure out what's wrong with it. Can anyone lend me a hand please.

onclick='if (!confirm("a\'b")) return false;SWESubmitForm(document.SWEForm0_0,c_0,"","VRId-0"); return false;'

Thanks.
0
Comment
Question by:wkwong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 6

Expert Comment

by:CyberGhost
ID: 8172839
onclick="if (!confirm('a\b')) return false; SWESubmitForm(document.SWEForm0_0,c_0,'','VRId-0'); return false;"

... also you may have an error in function SWESubmitForm
0
 
LVL 33

Expert Comment

by:hongjun
ID: 8172852
Try this
onclick='if (!confirm("a'b")) return false;SWESubmitForm(document.SWEForm0_0,c_0,"","VRId-0"); return false;'


hongjun
0
 

Author Comment

by:wkwong
ID: 8172972
Maybe some more information would be helpful..

My expected message would be  a'b, and the tricky part here is that I do not have an option to use "a'b"  because I have to rely on constructing the confirm message using special character formatting, i.e the backslash.
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 12

Accepted Solution

by:
ahosang earned 300 total points
ID: 8173594
could try:
onclick="if (!confirm('a\'b')) return false;SWESubmitForm(document.SWEForm0_0,c_0,'','VRId-0'); return false"
0
 

Expert Comment

by:astacom
ID: 8174860
Will you post the code for the SWESubmitForm function?  The syntax for the code you showed looks fine.
0
 
LVL 6

Expert Comment

by:CyberGhost
ID: 8179493
If you'd like to have a'b as output, use:

onclick="if (!confirm(\"a'b\")) return false; SWESubmitForm(document.SWEForm0_0,c_0,'','VRId-0'); return false;"

hope this helps
0
 
LVL 6

Expert Comment

by:CyberGhost
ID: 8179517
... sorry, my mistake. That ahosanq's solution is OK. Mine have a little error. So just for confirmation:

onclick="if (!confirm('a\'b')) return false;SWESubmitForm(document.SWEForm0_0,c_0,'','VRId-0'); return false"
 
... is a good way to display a'b

regards
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10149051
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: ahosang {http:#8173594}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

762 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