can somebody explain me where to put "{ }" and ";" symbols on a script?
i did search the web but didn't find any explanation written in a way i can understand.
example of a code that i tried and doesn't work
Notes:
# the click button works
# it is inside the body of an HTML code...
# im a "newb"
# Links are welcome
i did search the web but didn't find any explanation written in a way i can understand.
example of a code that i tried and doesn't work
Code:
<script Language="JavaScript">
function distance()
}
alert("Point One");
var x = prompt("Enter a X variable for the first point", "X");
var y = prompt("Enter a Y variable for the first point", "Y");
alert("Point Two");
var x$ = prompt("Enter a X variable for the second point", "X");
var y$ = prompt("Enter a Y variable for the second point", "Y");
var x# = x$-x
var y# = y$-y
var x@ = Math.pow(x#,2)
var y@ = Math.pow(y#,2)
var D = y@+x@
var Ds = Math.sqrt(D);
document.write("The distance between the points")
document.write("("+x+","+"y"+")")
document.write("("+x$+","+y$+")")
document.write("Is "+Ds)
{
</script>
<FORM>
<INPUT TYPE="button" onClick="distance()" value="Go!">
# the click button works
# it is inside the body of an HTML code...
# im a "newb"
# Links are welcome
Comment