Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 29th, 2004, 02:45 AM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unterminated string constant (javascript&asp)

Hello,
Hopefully somebody could help me with this problem that has really started to piss me off...
I have a code combined with vbscript and javascript and have a weird "Unterminated string constant" error. Its weird because it doesn't occur on every server where its running.
Here's part of the code:

if (parent.islocked == '1') {
    alert('<%=GetLocale("invoices.asp","lockedinvoice" )%>: ' + parent.lockedby);
    parent.islocked=0;
    parent.lockedby='';
    history.back();
}

The point of it is that all the header texts are in array (the text depends on the language user has defined so it can't be hard coded) and they are picked from there with GetLocale function and the javascript pops up a message box if necessary. The weird part is that most of the time the source code from IE looks like this:

if (parent.islocked == '1') {
    alert('Invoice has been locked: ' + parent.lockedby);
    parent.islocked=0;
    parent.lockedby='';
    history.back();
}


And sometimes like this with "Unterminated string constant" error:

if (parent.islocked == '1') {
    alert(Invoice has been locked
: ' + parent.lockedby);
    parent.islocked=0;
    parent.lockedby='';
    history.back();
}

I would appreciate a lot if somebody could give a good explanation for this.

Beatmasta

 
Old May 17th, 2004, 11:58 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Im wondering if the '' is being picked up as " in this line of code:
parent.lockedby='';

cheers
interrupt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unterminated String Constant loydcampbell Classic ASP Basics 3 December 11th, 2007 09:40 PM
Unterminated String constant byge0rg Javascript 1 February 11th, 2007 09:45 PM
Unterminated String Constant Apocolypse2005 Javascript 2 June 22nd, 2006 08:36 AM
unterminated string constant Stubby HTML Code Clinic 1 February 3rd, 2005 05:56 AM
Unterminated String Constant Ben Horne Javascript 7 October 21st, 2004 11:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.