473,378 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Unterminated String Literal Error

Hiya,

Im trying to embed some Javascript into some xhtml which is embedded into a php file.

The line causing a problem is this:
Expand|Select|Wrap|Line Numbers
  1. <form id=\"deletetopic\" name=\"deletetopic\" method=\"post\" action=\"delete_topic.php\" onsubmit=\"confirm('Are you sure you want to this topic?\n\n + Please note all posts will be lost!');\">
However, the firefox javascript points out that the error is after the "confirm(' " so I have no idea.
Can anyone help?
Thanks, William.
Sep 8 '07 #1
2 3678
pbmods
5,821 Expert 4TB
Heya, William.

Please use CODE tags when posting source code:

[CODE=html]
HTML code goes here.
[/CODE]

My guess is that your server-side language is interpreting the '\n's as literal line breaks. Try escaping them: \\n
Sep 8 '07 #2
Hiya,

Im trying to embed some Javascript into some xhtml which is embedded into a php file.

The line causing a problem is this:
Expand|Select|Wrap|Line Numbers
  1. <form id=\"deletetopic\" name=\"deletetopic\" method=\"post\" action=\"delete_topic.php\" onsubmit=\"confirm('Are you sure you want to this topic?\n\n + Please note all posts will be lost!');\">
However, the firefox javascript points out that the error is after the "confirm(' " so I have no idea.
Can anyone help?
Thanks, William.
I'd suggest that it's from your PHP. You're probably doing something like this:

Expand|Select|Wrap|Line Numbers
  1. echo '<form id=\"deletetopic\" name=\"deletetopic\" method=\"post\" action=\"delete_topic.php\" onsubmit=\"confirm('Are you sure you want to this topic?\n\n + Please note all posts will be lost!');\">';
which would cause the unterminated error at the ' after confirm(.
Sep 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: vanitha | last post by:
Hi All, I am using "C" to generate the javascript code. And i am getting the following error message "Unterminated string literal" in the mozilla webbrowser for the following syntax. unsigned...
1
by: larrylyons | last post by:
I don't understand why I'm getting Unterminated String Literal error MY JAVASCRIPT function test(){ newWindow =...
7
by: vunet.us | last post by:
I have a function to open new window: function bla(){ newwin = window.open("page.asp?file=1&id=<%=ID %>","Image","other params") } This function works fine mostly, but sometimes, there is a...
7
basstradamus
by: basstradamus | last post by:
Hi When I am trying to eveluate object literal It causing Unterminated string constans error (firefox). var obiekt = (eval("("+data+")")); the data is carring object literal recived from server...
2
by: rajuk | last post by:
Hi i have following code,when i execute this code i got unterminated string constant error.any javascript guru can you look into this please. raju /* The link details */ var links = new Array...
1
by: VUNETdotUS | last post by:
Let's say I have a string: div.innerHTML = "<a onclick='foo(\""+myWord+"\");'></a>"; in IE only (tested version 7) if var myWord = "English" then it works fine but if var myWord = "Modifier...
0
by: manojpolawar2008 | last post by:
Hi, I am using the fckeditor with asp.net2.0. I have declared and initialized and the FCKEditor on code behind(ie on aspx.vb) page. and i wan to set the ViewState value to FckEditor on...
1
renji1981
by: renji1981 | last post by:
Hi pals Hers my link Primus Infotech Solutions - IT Services , Product Engineering , Web Based Applications Here Im getting a Unterminated String constant Error When you click on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.