- JavaScript is the default scripting language for browsers but VBScript must be specified as the scripting language.
<script type="text/vbscript" - JavaScript has cross-platform support from all popular browsers while VBScript is supported MS IE only.
- JavaScript is case sensitive but VBScript is not this would not be prone to as many syntax errors.
- In Javacsript there is no way to force variables to be declared, but in VBscript if "Option explicit" statement is declared then it is mandatory to declare all vars before being used.
- In VBscript can’t assign values to variable on same line, but in Javascript you can.
Javascript: var z = 10
VBscript:
Dim z
z = 10 - JavaScript uses the same character for concatenation as it does for addition (the + character) while the '&' concatenating character is used in VBScript. This is another source of errors in JavaScript. Javascript example-
[Concatenation]
var x
x = "God"
x = x + " is great!"
[Addition]
int x=1
int y=2
int z
z=x+y
I think writing blogs is indeed an activity done by intellectual people. So I am also following the same way. It is good practice to convert whatever going into your mind to specific words and sharing your knowledge. Here I will keep sharing my thoughts and share some technical topics related to my profession as well.
Friday, 21 September 2012
Comparison of JavaScript and VBScript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment