Help - Search - Members - Calendar
Full Version: Javascript
Forums > Resource Center > Webmasters' Corner > Webmasters' Corner Resolved Topics
SNAP_Tornado
i need help with this code now
CODE
<!-- begin code provided by createblog.com -->
<html>

<head>
<title>
examples!!
</title>

<script language="Javascript">

var like_color = prompt ("Which Color do you like?", "Red or blue?")

if (like_color == "blue")
}
document.writeln("YOU LIKE BLUE??? The monkey thinks that u're kool!")
{

</script>

</head>
<!-- end code provided by createblog.com -->


sigh...plz help it's giving me an error message thx! happy.gif
aznriceboi
what is the javascript suppose to do?
Revolt
Your open and close braces are reversed.

it should be:

if (condition)
{
// code
}

Also I'm not very well versed in java/jscript but it seems to be just like C, so I'd imagine you need to have a ; at the end of expressions to end the line.
SNAP_Tornado
o...hehe...whoops sry!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.