Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Unterminated String Constant error

Posted on 2003-03-20
9
Medium Priority
?
506 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
8 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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

581 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