Benches Mail, Safari and messaging
Weird Parsing Error in Safari 5.0
Imported from the Apple Support Forums via the Wayback Machine 🔗
I've just updated my web browser to Safari 5.0 and I'm in a "Introduction to JavaScript" class. I'm trying to do a lab which:
1). Creates a website that includes: - Your name (First and Last)
2). Sets up a unordered list with Three links to your favorite websites
The problem is that though my code works in Firefox, I keep getting a Syntax Error: Parse Error at line 15 (Where the document.write statement outputs a unordered list of "a href" url links). I'm at wits end and the syntax seems fine. Does anyone have any suggestions? Oh, by the way here's my code for the lab:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Lab1</title>
<script type="text/javascript">
//Prompts for my name
var userName = prompt("Please enter your name");
document.write (userName);
//displays my picture and my favorites places in HTML
document.write("<br />");
document.write("<img src='mygradpic.jpg'/>");
document.write("<br />");
document.write("My Favorite Places");
document.write(<ul>
<li><a href="http://www.seattle.gov/parks/park_detail.asp?ID=307">Greenlake Park in Seattle,WA</a></li>
<li><a href="http://www.cinerama.com/TemplateHome.aspx?contentId=1">Cinerama Theatre in Downtown Seattle</a></li>
<li><a href="http://www.spl.org/">The Seattle Public Library</a></li>
</ul>);
</script>
</head>
<body>
</body>
</html>
1 reply
Sign in or join Beachball Help to reply.
- 0