Problem with an unterminated string constant perhaps

J

Jari Hujanen

Thank you for the advice. I tried without success:
- the document.close() method in the end
- document.write(arrayBusiness.join(''));

In addition to that, I also tried this code (writing the whole string in
document.write as you suggested):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Comp</title>
</head>
<body>
<script type="text/javascript">
document.write('<h4>Business</h4><ul><li><a
href=\"http://www.nordea.fi/\">Nordea</a></li><li><a
href=\"http://www.aarre.fi/aarre/aloitus.jsp\">Aarre.fi</a></li><li><a
href=\"http://www.kuluttajavirasto.fi/\">Kuluttajavirasto</a></li><li><a
href=\"https://www.palkka.fi/\">Palkka.fi</a></li><li><a
href=\"http://www.prh.fi/fi/kaupparekisteri.html\">PRHn
Kaupparekisteri</a></li><li><a
href=\"http://www.suomi.fi/suomifi/suomi/asiointi_ja_lomakkeet/\">Suomi.fi
– Asiointi ja lomakkeet</a></li><li><a
href=\"http://www.syt.fi/\">Suomen Yrittäjäin Työttömyyskassa
(SYT)</a></li><li><a href=\"http://www.vakes.fi/\">Vakuutuskeskus
(Vakes)</a></li>
<li><a
href=\"http://www.vero.fi/default.asp?article=2216&language=FIN\">Vakuutusmaksuvero-ohje</a></li><li><a
href=\"http://www.vm.fi/vm/fi/10_verotus/index.jsp\">Valtiovarainministeriö
– Verotus</a></li></ul>');
document.close();
</script>
</body>
</html>

The previous code didn't work either. I tried that with and without the
document.close() method.

But I got to know about the debugger in IE7 so I used it. The debugger
always complained about an unterminated string constant. I don't understand.
I think I have used single and double quotation marks in matching pairs and
double quotation marks with the escape character in the front of them and I
wrote all the quotation marks anew in Notepad to make sure they don't come
from Word or another unsuitable word processor but nothing helps. I will try
to find info about "unterminated string constant" by Google.
 
J

Jari Hujanen

I'm sorry. This went to a wrong place. This should have gone to the thread
"Problem with array only accepting a few rows or elements" as a reply to
RobG. I hope the moderator deletes this message.
 
T

Trevor Lawrence

--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org
Jari Hujanen said:
Thank you for the advice. I tried without success:
- the document.close() method in the end
- document.write(arrayBusiness.join(''));

In addition to that, I also tried this code (writing the whole string in
document.write as you suggested):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Comp</title>
</head>
<body>
<script type="text/javascript">
document.write('<h4>Business</h4><ul><li><a
href=\"http://www.nordea.fi/\">Nordea</a></li><li><a
href=\"http://www.aarre.fi/aarre/aloitus.jsp\">Aarre.fi</a></li><li><a
href=\"http://www.kuluttajavirasto.fi/\">Kuluttajavirasto</a></li><li><a
href=\"https://www.palkka.fi/\">Palkka.fi</a></li><li><a
href=\"http://www.prh.fi/fi/kaupparekisteri.html\">PRHn
Kaupparekisteri</a></li><li><a
href=\"http://www.suomi.fi/suomifi/suomi/asiointi_ja_lomakkeet/\">Suomi.fi
– Asiointi ja lomakkeet</a></li><li><a
href=\"http://www.syt.fi/\">Suomen Yrittäjäin Työttömyyskassa
(SYT)</a></li><li><a href=\"http://www.vakes.fi/\">Vakuutuskeskus
(Vakes)</a></li>
<li><a
href=\"http://www.vero.fi/default.asp?article=2216&language=FIN\">Vakuutusmaksuvero-ohje</a></li><li><a
href=\"http://www.vm.fi/vm/fi/10_verotus/index.jsp\">Valtiovarainministeriö
– Verotus</a></li></ul>');
document.close();
</script>
</body>
</html>

The previous code didn't work either. I tried that with and without the
document.close() method.

But I got to know about the debugger in IE7 so I used it. The debugger
always complained about an unterminated string constant. I don't
understand. I think I have used single and double quotation marks in
matching pairs and double quotation marks with the escape character in the
front of them and I wrote all the quotation marks anew in Notepad to make
sure they don't come from Word or another unsuitable word processor but
nothing helps. I will try to find info about "unterminated string
constant" by Google.

I did not read the OP But

line 09 has document write('
line 29 has (SYT) so document.write( ends at ')' after SYT

Try escaping the ) symbol wherever it appears , e.g.
(SYT\)
(Vakes\)
 
T

Trevor Lawrence

PS, I usually don't mention things like that, but you put your signature
at the top of your reply. This technically makes the rest of what you
wrote part of the signature and causes problems for others when they try
to reply.

Conrad,
Thanks for the other parts of your post

But the above was a pure mistake,

My OE is set up to put the sig at the top. So I usually cut and paste from
the top to the bottom. This time I forgot and added another sig at the
bottom. So yes, it was wrong and I actually noticed it *after* I had posted

Thanks again,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top