473,568 Members | 2,850 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unterminated String Constant error

1 New Member
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.

/* The link details */
var links = new Array ("link1", "link2", "link3");
var links_text = new Array ("Link 1", "Link 2", "Link 3");
var links_url = new Array ("link1.htm" , "link2.htm","li nk3.htm");

/* Resolve the location */
var loc=String(this .location);

/* Menu generating function */
function dyn_menu_gen()
for(var i=0; i<links.length ; i++)
document.write( '<table class="explorer _active"
onmouseover="th is.className=\' explorer_active \';return true"
onmouseout="thi s.className=\'e xplorer_active\ ';return true" onmousedown="th is.className=\' explorer_active \';return true"
onclick="locati on.href=\'' + links_url[i] + '\'"><tr><td> <a href="' + links_url[i] + '" class="menu">'+ links_text[i] + '<b></b></a></td></tr></table>');

document.write( '<table class="explorer " onmouseover="th is.className=\' explorer_over\' ;return true"
onmouseout="thi s.className=\'e xplorer\';retur n true"
onmousedown="th is.className=\' explorer_down\' ;return true"
onclick="locati on.href=\''+ links_url[i] + '\'">
<tr><td><a href="' + links_url[i] +'" class="menu">'+ links_text[i] + '</a></td></tr></table>);
document.write( <table cellspacing="0" cellpadding="0" bgcolor="#FFFFF F"><tr><td></td></tr></table>');
May 24 '07 #1
2 3107
1,208 Recognized Expert Top Contributor
This is very sloppy can you tell us what line your having the problem on?
May 24 '07 #2
428 Contributor
document.write( '<table class="explorer _active"
onmouseover="th is.className=\' explorer_active \';return true"
All of your line breaks break your string

'<table class="explorer _active" '+
'onmouseover="t his.className=\ 'explorer_activ e\';return true" '+

' continue string...
May 24 '07 #3

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

Similar topics

by: KathyB | last post by:
Hi, this is the first lines of a function. Although it runs, it still throws an "Unterminated string constant" error in the browser. It is all in one line, just wouldn't fit here. The error appears to occur right after type='+typeIn+'&id <----before the = Any clues appreciated! Thanks, Kathy
by: Tav | last post by:
this seems to be a very generic error message, and the fact that i have no way of locating what causes the error is frustrating. anyway, i'll be general with my problem. i have a div on my page that contains some information, and i made it like a window, as in it can be maximized and closed by javascript functions in the page. the function...
by: William | last post by:
I have the following javascript function that updates a scroll_list and sends the updated entry (with its index) to a server script ( i.e. http://mkmxg00/cgi/confirmUpload.pl ) for further processing: function saveText( scroll_list, t_area, listToBeUpdated ) { scroll_list.options.text = t_area.text; scroll_list.options.value= t_area.value;...
by: polilop | last post by:
When i open my page in IE it shows an error Unterminated string constant om Line..... When i look at the line it shows the line where the </SCRIPT> tag is ???? Moziila dose not see this error, allso avant browser (shell for IE) dosent see it. the script works fine, i'm just anoyed with IE calling errors. Anybody know why this is?
by: ken s | last post by:
From server-side code I'm using Response.Write to display a javascript alert box. It works fine except when I try to include a new line character, which causes this javascript error: "Unterminated string constant" Here's my c# code: strText = "Line 1 text\nLine2 text"; Response.Write("<script>alert('" + strText + "');</script>");
by: Chrisjc | last post by:
I Have no IDEA what this error code means on my page.. I have chech the lines listed and just doesnt add up.. here is the error Line: 11 Char: 38 Error: Unterminated string constant Code: 0 URL: IntakeSystemstest.php and here is the code starting from line 1 to line 30
by: cubicalmonkey | last post by:
Hello, I'm attempting to get this code to work in IE. The script I have below works fine in Firefox but doesn't work in IE. Basically this script adds an onclick function to radio buttons of a form which is dynamically generated by a java applet. (I'm not familiar with the java applet nor do I have any control over it.) Does anyone have any...
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 Cha\u00EEnes" then I get "Unterminated string constant" error. What fix would you suggest to keep div.innerHTML = "" format?
by: hemantbasva | last post by:
i have written a the following javascript code to copy data onto clipboard but i am getting error Unterminated string constant code in cs file if (lblProcedureID != null) { lnkHold.Attributes.Add("onclick", "javascript:copyText('Procedure Id-" + lblProcedureID.Text + " Proceudre Title-" +...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.