I was wondering if there was someone out there that would take pity on my poor soul? I have a piece of JavaScript that is trying its level best to put me into an early grave. I am very new to all of this and would be eternally gre开发者_运维问答atful if someone could see thier way to helping me before I lose the will to live.
I have to add the following two groups, occasion and name of sender, to the piece of JavaScript below:
<html>
<head>
<title>(ii)</title)
var recipient
// Declare other variables here
recipient =
window.prompt ('Please enter the name of the recipient', '');
// prompt for other values here
// output the customised greeting here
</script>
</head>
<body>
</body>
</html>
I'm no web genius, nor am I the religious type who can help you with this "soul" business, but it seems to me you are missing the opening <script>
tag.
Also, the closing </title>
should end with >
and not )
.
Update: looking at the edit history, it looks like the missing and malformed tags were introduced by another SO reader who was editing your question. Sorry about that.
Two problems:
- The
<title>
tag isn't closed. - The
<script>
tag isn't opened.
You won't be able to get all those fields into JavaScript pop-ups. Even if you could, you would run into trouble when you try and send some sort of message using JavaScript (that's what it looks like you're trying to do, any way).
If you write an HTML form and have it post to a server that uses something like PHP or Servlets, you might have better luck.
精彩评论