LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2004, 06:52 PM   #1
unimaginative
Member
 
Registered: Aug 2003
Location: USA
Distribution: SuSE 8.2 Professional
Posts: 159

Rep: Reputation: 30
Javascript question


what is wrong with this code

Code:
<html>
<head>
<SCRIPT language="JavaScript">
var name= prompt('What is your name',' ');
</script>
</head>
<body>
<SCRIPT language="JavaScript">
document.write("<CENTER><H1>Hello, " + name"<\/H1><\/CENTER>");
</script>
</body>
</html>
 
Old 01-24-2004, 07:01 PM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Code:
<html>
<head>
<script type="text/javascript" language="JavaScript">
var name= prompt('What is your name',' ');
</script>

<title></title>
</head>
<body>
<script type="text/javascript" language="JavaScript">
document.write("<CENTER><H1>Hello, " + name"<\/H1><\/CENTER>");
</script>
</body>
</html>
how's this??
 
Old 01-25-2004, 09:15 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
You are missing a +:
document.write("<CENTER><H1>Hello, " + name"<\/H1><\/CENTER>");
should be:
document.write("<CENTER><H1>Hello, " + name + "<\/H1><\/CENTER>");
 
Old 01-26-2004, 03:32 PM   #4
unimaginative
Member
 
Registered: Aug 2003
Location: USA
Distribution: SuSE 8.2 Professional
Posts: 159

Original Poster
Rep: Reputation: 30
yeah thanks for helping me, everyone i see the problem, i needed to accomodate the additional string
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question python javascript. moby Programming 2 07-16-2004 11:55 AM
He, ANOTHER javascript question Squall Programming 3 01-27-2004 07:10 PM
JavaScript Question jacksmash Programming 8 12-23-2003 06:01 PM
Javascript question? mikeshn Programming 2 08-22-2002 04:44 PM
JavaScript Question vance Programming 2 04-14-2002 01:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration