/    Sign up×
Community /Pin to ProfileBookmark

Execution quits in script.

I have what is likely a tyro question; I have 35 years experience in software, but JavaScript is new to me.

My html page (excerpted) looks like this:

[CODE]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 3.2 Final//EN”>
<html>
<head>
<title>Stuff in Alabama</title>
<link rel=stylesheet href=”/th/styles/style_i4.css” type=”text/css”>
<script language=”javascript”>
function display1 (st, URL, producer, title, address, address2, city, phone1, phone2, fax, email)
{
alert (‘In display function.’);
document.write (‘<tr><td>’);
// yada, yada
document.write (‘</td></tr>n’);
}
</script>
</head>

<body color=0>
<h1>Alabama</h1>
<div align=”center”>
<a name=”Anniston”></a><h2>Anniston Area:</h2>
<table border width = “50%”>
<script language=”javascript”>
alert (‘Alert1’);
display1 (‘al’, ‘www.alpha.com/’, ”, ‘Alpha’, ‘Address’, ”, ‘City’, ”, ”, ”, ”);
alert (‘Alert2’);
display1 (‘al’, ‘beta.com’, ”, ‘Beta’, ‘Addressb’, ”, ‘cityb’, ”, ”, ”, ”);
</script>
</table>
<a name=”Auburn”></a><h2>Auburn Area:</h2>
<table border width = “50%”>
<script language=”javascript”>
alert (‘Alert1b’);
display1 (‘al’, ‘www.alpha.com/’, ”, ‘Alpha’, ‘Address’, ”, ‘City’, ”, ”, ”, ”);
alert (‘Alert2b’);
display1 (‘al’, ‘beta.com’, ”, ‘Beta’, ‘Addressb’, ”, ‘Cityb’, ”, ”, ”, ”);
</script>
</table>
</div>[/CODE]

All I get out of this is the first alerts after the <script> tags. The display1 function does not get executed (the alert in there never happens), and execution seems to skip to the next </script> tags, because all the <h2> titles are there. but the second alert in either case never happens. So, what part of the JavaScript Guide did I miss here?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@NatdripMay 19.2007 — works fine:

[CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Stuff in Alabama</title>
<link rel=stylesheet href="/th/styles/style_i4.css" type="text/css">
<script language="javascript">
function display1 (st, URL, producer, title, address, address2, city, phone1, phone2, fax, email)
{
//alert ('In display function.');
document.write ('<tr><td>');
document.write(st+', '+URL+', '+producer+', '+title+', '+address+', '+address2+', '+city+', '+phone1+', '+phone2+', '+fax+', '+email)
document.write ('</td></tr>n');
}
</script>
</head>

<body color=0>
<h1>Alabama</h1>
<div align="center">
<a name="Anniston"></a><h2>Anniston Area:</h2>
<table border width = "50%">
<script language="javascript">
display1 ('al', 'www.alpha.com/', '', 'Alpha', 'Address', '', 'City', '', '', '', '');
display1 ('al', 'beta.com', '', 'Beta', 'Addressb', '', 'cityb', '', '', '', '');
</script>
</table>
<a name="Auburn"></a><h2>Auburn Area:</h2>
<table border width = "50%">
<script language="javascript">
display1 ('al', 'www.alpha.com/', '', 'Alpha', 'Address', '', 'City', '', '', '', '');
display1 ('al', 'beta.com', '', 'Beta', 'Addressb', '', 'Cityb', '', '', '', '');
</script>
</table>
</div>
</body>
</html>[/CODE]
×

Success!

Help @SkoreKeep spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...