Declare java script variables
Total Newbie to java script
Is this the correct way to declare variables ?
<head>
<script type='text/javascript'>
var InPutFeet;//feet entered by user
var Multipler;// Based on pitch selected from combobox eg; .25, .41 etc
var FeetToAdd;//feet entered by user x Multipler
var TotalFeet;//Total square feet with pitch added
var TotalSquares;// TotalFeet / 100
</script>
</head>
Re: Declare java script variables
Yes, you have properly declared variables there. However, those are all global scope variables, as you don't have them in a 'class' or a function.
Re: Declare java script variables
Also note the character casing, as this is not as friendly as VB. Had to find out the hard way.
About global variables: There is also a very ugly way to declare them inside a function and still have them as global. You can do that without using the "var" . I wouldn't recommend this approach, unless there is something very specific to do.
Re: Declare java script variables