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 9th, 2004, 02:00 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default Unterminated String Constant

Hi all,

I was hoping someone could help me on this. I am working on a page that is supposed to have a sortable table. I entered the code as follows but I got an error for line 326.

Here's the full error message

Line: 326
Error: Unterminated string constant

Here's the code

<HTML>
<HEAD>

<TITLE>Nomad Ltd - Selecting a tent</TITLE>

<LINK REL="stylesheet" HREF="nomadltd.css" TYPE="text/css">

<STYLE>
<!--
.tenthead {font-family: arial, sans-serif; font-size: 14pt}
.button {font-family: impact, arial; font-size: 8pt}
//-->
</STYLE>

<SCRIPT LANGUAGE="javascript">
<!--
Nav4 = (document.layers) ? 1:0;
IE4 = (document.all) ? 1:0;

if(!IE4) {window.onerror=null}

totalTents = 0;
function countHeaders() {
   for (var i = 0; i < document.all.length; i++){
    var el = document.all[i].name;
    if ("tent" == el){
        totalTents++;
        }
    }
}

function reCount() {
    totalTents--
    textnum.innerHTML=totalTents
}

function cycle(el, text, time) {
        if (el.selNum == null) {
                el.texts = new Array();
                el.currText = "";
                el.currNum = 0;
                el.selNum = 0;
                el.length = 0;
                for (el.i = 0; el.i < text.length; el.i++) {
                        if (text.charAt(el.i) == ",") {
                                el.texts[el.currNum] = el.currText;
                                el.currText = "";
                                el.currNum++;
                                el.i++;
                        }
                        el.currText = el.currText + text.charAt(el.i);
                }
                el.texts[el.currNum] = el.currText;
                el.length = el.currNum;
        }
        if (el.selNum < el.length) {
                el.selNum = el.selNum + 1;
        } else {
                el.selNum = 0;
        }
        {
                el.innerHTML = el.texts[el.selNum];
        }
        ab1 = window.setTimeout("cycle(" + el.id + ",'" + text + "'," + time + ");", time * 100);
}
//-->
</SCRIPT>

</HEAD>

<BODY BACKGROUND="Egg shell.jpg">

<IMG SRC="nomad.jpg" ALIGN="left">

<DIV ID="txt1" ALIGN="right" CLASS="tenthead" STYLE="font-size: 18pt"></DIV>

<SCRIPT LANGUAGE="javascript">
<!--
function addCycle() {
    cycle(txt1, "Hiking,Bicycling,Camping,Kayaking,Climbing,fi nd all your gear at,nomadltd.com", 30)
}

if(IE4) {window.onload = new Function("addCycle()")}
//-->
</SCRIPT>

<BR><BR><BR>
<DIV ALIGN="center" STYLE="font-size: 24pt; font-weight: bold; font-family: arial; font-style: normal">Tents</DIV>
<H2 ALIGN="center">Selecting one that's right for you</H2>
<BR>

<DIV>Choosing a quality tent that meets your needs can be an intimidating task. To help you out with this important decision, we've added features to this page to make it easier to compare the characteristics of our tents.
<BR><BR>
As you narrow your choices, click the Remove button for each tent that you're no longer considering, to remove it from the page.</DIV><BR>

<H1>Tent footprints and descriptions</H1>

<DIV ID="tent1" name="tent">

<DIV CLASS="tenthead" onMouseOver="star.src='starcolor.jpg'" onMouseOut="star.src='starlite.jpg'"><IMG SRC="starlite.jpg" ALIGN="left" ID="star">XTC Starlite</DIV>
<DIV>One of the lightest, most compact three-season tents available. Featuring two-pole clip design with a built-in vestibule.</DIV>

<SCRIPT LANGUAGE="javascript">
<!--
if (IE4) {
    document.write("<BUTTON CLASS='button' onClick=tent1.outerHTML='',reCount()>Remove Starlite</BUTTON>")
}
//-->
</SCRIPT>

<BR><BR><BR>

</DIV>

<DIV ID="tent2" name="tent">

<DIV CLASS="tenthead" onMouseOver="brev.src='brevcolor.jpg'" onMouseOut="brev.src='brevifolia.jpg'"><IMG SRC="brevifolia.jpg" ALIGN="left" ID="brev">Amano Brevifolia</DIV>

<DIV>The simple, vaulted design characterized by two doors and two vestibules returns with the 2000 Brevifolia model. New features include: ground level, rainfly with vents, and vaulted sleeves for smoother pole feeding.</DIV>

<SCRIPT LANGUAGE="javascript">
<!--
if (IE4) {
    document.write("<BUTTON CLASS='button' onClick=tent2.outerHTML='',reCount()>Remove Brevifolia</BUTTON>")
}
//-->
</SCRIPT>

<BR><BR>

</DIV>

<DIV ID="tent3" name="tent">

<DIV CLASS="tenthead" onMouseOver="tri.src='tricolor.jpg'" onMouseOut="tri.src='trifolia.jpg'"><IMG SRC="trifolia.jpg" ALIGN="left" ID="tri">Amano Trifolia</DIV>

<DIV>Light without sacrificing comfort, if you demand space when you're camping, the Trifolia delivers. Features all Amano quality standards: ground level, rainfly with vents, and smooth pole feeding.</DIV>

<SCRIPT LANGUAGE="javascript">
<!--
if (IE4) {
    document.write("<BUTTON CLASS='button' onClick=tent3.outerHTML='',reCount()>Remove Trifolia</BUTTON>")
}
//-->
</SCRIPT>

<BR><BR>

</DIV>

<DIV ID="tent4" name="tent">

<DIV CLASS="tenthead" onMouseOver="hillside.src='hillsidecolor.jpg'" onMouseOut="hillside.src='hillside.jpg'"><IMG SRC="hillside.jpg" ALIGN="left" ID="hillside">Vista Hillside</DIV>

<DIV>Unbeatable value for 3-season camping. Lightweight, durable, weatherproof protection. Rectangular floor, 2-pole configuration, mesh door, window, and interior pockets.</DIV>

<SCRIPT LANGUAGE="javascript">
<!--
if (IE4) {
    document.write("<BUTTON CLASS='button' onClick=tent4.outerHTML='',reCount()>Remove Hillside</BUTTON>")
}
//-->
</SCRIPT>

<BR><BR>

</DIV>

<DIV ID="tent5" name="tent">

<DIV CLASS="tenthead" onMouseOver="hilltop.src='hilltopcolor.jpg'" onMouseOut="hilltop.src='hilltop.jpg'"><IMG SRC="hilltop.jpg" ALIGN="left" ID="hilltop">Vista Hilltop</DIV>

<DIV>Tunnel design offers maximum space for very little weight. Mesh ceiling for view and ventilation. Factory sealed, with protected vestibule and interior pockets.</DIV>

<SCRIPT LANGUAGE="javascript">
<!--
if (IE4) {
    document.write("<BUTTON CLASS='button' onClick=tent5.outerHTML='',reCount()>Remove Hilltop</BUTTON>")
}
//-->
</SCRIPT>

<BR><BR>

</DIV>

<DIV ID="tent6" name="tent">

<DIV CLASS="tenthead" onMouseOver="peak.src='peakcolor.jpg'" onMouseOut="peak.src='peak.jpg'"><IMG SRC="peak.jpg" ALIGN="left" ID="peak">Vista Peak</DIV>

<DIV>Easy setup, 3-season tent for 2. Two doors with vestibules offer easy access and protected sotrage space. Mesh ceiling panel for view and ventilation. Factory sealed, with vestibule and interior pockets.</DIV>

<SCRIPT LANGUAGE="javascript">
<!--
if (IE4) {
    document.write("<BUTTON CLASS='button' onClick=tent6.outerHTML='',reCount()>Remove Peak</BUTTON>")
}
//-->
</SCRIPT>

<BR><BR>

</DIV>

<DIV ID="tent7" name="tent">

<DIV CLASS="tenthead" onMouseOver="summit.src='summitcolor.jpg'" onMouseOut="summit.src='summit.jpg'"><IMG SRC="summit.jpg" ALIGN="left" ID="summit">Vista Summit</DIV>

<DIV>Comfortable, rugged, 4-season tent. Quick setup, full rainfly, integral vestibule, large door. Factory sealed, mesh window and door for ventilation.</DIV>

<SCRIPT LANGUAGE="javascript">
<!--
if (IE4) {
    document.write("<BUTTON CLASS='button' onClick=tent7.outerHTML='',reCount()>Remove Summit</BUTTON>")
}
//-->
</SCRIPT>

<BR><BR>

</DIV>

<H2 ALIGN="center">Nomad Ltd has a tent that's right for you!</H2>

<SCRIPT>
<!--
if (IE4) {
    countHeaders()
    document.write("<H1 ALIGN='center'>This page describes ")
    document.write("<SPAN ID='textnum'>")
    document.write(totalTents)
    document.write("</SPAN>")
    document.write(" tent models.</H1>")
}
//-->
</SCRIPT>

<OBJECT ID="tentlist" CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
    <PARAM NAME="DataURL" VALUE="tents.txt">
    <PARAM NAME="UseHeader" VALUE="True">
</OBJECT>

<TABLE BORDER="1" ID="elemtbl" DATASRC="#tentlist">
<THEAD>
<TR>
<TD><B><DIV ID=tent>Tent</DIV></B></TD>
<TD><B><DIV ID=catno>Catalog number</DIV></B></TD>
<TD><B><DIV ID=area>Area (sq ft)</DIV></B></TD>
<TD><B><DIV ID=vest>Vestibule (sq ft)</DIV></B></TD>
<TD><B><DIV ID=desc>Description</DIV></B></TD>
<TD><B><DIV ID=cap>Capacity</DIV></B></TD>
<TD><B><DIV ID=weight>Weight</DIV></B></TD>
<TD><B><DIV ID=price>Price</DIV></B></TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD><DIV DATAFLD="tent"></DIV></TD>
<TD><DIV DATAFLD="catno"></DIV></TD>
<TD><DIV DATAFLD="area"></DIV></TD>
<TD><DIV DATAFLD="vest"></DIV></TD>
<TD><DIV DATAFLD="desc"></DIV></TD>
<TD><DIV DATAFLD="cap"></DIV></TD>
<TD><DIV DATAFLD="weight"></DIV></TD>
<TD><DIV DATAFLD="price"></DIV></TD>
</TR>
</TBODY>
</TABLE>

<BR>

<SCRIPT LANGUAGE="javascript">
<!--
function tentClick() {
    tentlist.Sort="tent";
    tentlist.Reset();
}

tent.onclick=tentClick;

function catnoClick() {
    tentlist.Sort="catno";
    tentlist.Reset();
}

catno.onclick=catnoClick;

function areaClick() {
    tentlist.Sort="area";
    tentlist.Reset();
}

area.onclick=areaClick;

function vestClick() {
    tentlist.Sort="vest";
    tentlist.Reset();
}

vest.onclick=vestClick;

function descClick() {
    tentlist.Sort="desc";
    tentlist.Reset();
}

desc.onclick=descClick;

function capClick() {
    tentlist.Sort="cap";
    tentlist.Reset();
}

cap.onclick=capClick;

function weightClick() {
    tentlist.Sort="weight";
    tentlist.Reset();
}

weight.onclick=weightClick;
function priceClick() {
   tentlist.Sort="price";
   tentlist.Reset();
}

price.onclick="priceClick;

if (!IE4) {
    document.write("If your browser does not display the above table, please email us at the address below for up-to-date tent details and prices.<BR><BR>")
}
//-->
</SCRIPT>

<DIV>For more information on Nomad Ltd outdoor supplies, please email our <A HREF="MAILTO:[email protected]">sales department</A></DIV>

</BODY>
</HTML>


Thanks in advance,


Ben Horne
Madison Area Technical College student

-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"There are two kinds of people in the world: Those who claim to be Flash junkies and those who actually are Flash junkies"
__________________
Ben Horne
-------------------------
I don\'t want to sound like I haven\'t made any mistakes. I\'m confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
 
Old April 9th, 2004, 02:23 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

At the end of your code:

price.onClick="priceClick;

should be:

price.onClick=priceClick;

HTH,

Snib

P2P Member
<><
 
Old April 9th, 2004, 02:26 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

Thanks, man.

BTW, have you thought up any more FAQ additions for the Flash FAQ?

Quote:
quote:Originally posted by Snib
 At the end of your code:

price.onClick="priceClick;

should be:

price.onClick=priceClick;
Ben Horne
Madison Area Technical College student

-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"There are two kinds of people in the world: Those who claim to be Flash junkies and those who actually are Flash junkies"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unterminated string constant cnottingham Classic ASP Databases 8 October 28th, 2011 01:43 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
unterminated string constant mariakovacs Classic ASP Basics 3 January 26th, 2004 03:59 PM





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