Visual Studio .NET - Tell me the difference between Java Script and VB script in a sentence for interview purpose

Asked By chitanya chitanya on 18-Jan-07 04:17 AM

for interview purpose can any one tell me the difference between Java Script and Vb script

in a sentence

JavaScript & VBScript - mv ark replied to chitanya chitanya on 18-Jan-07 04:36 AM

JavaScript is a scripting language that works in all browsers whereas VBScript is a scripting language that works only in IE.

For detailed info, check -

javascript vs vbscript - sundar k replied to chitanya chitanya on 18-Jan-07 07:23 AM

Comparison of JavaScript and VBScript


1. Both languages are easy to learn and do not require any expensive development tools
2. Both can be used to enhance web pages
3. They run on client machines and can substitute CGI programs to reduce server loads
4. Both can abuse and run malicious scripts on clients' machines


1. JavaScript is the default scripting language for browsers but VBScript must be specified as the scripting language.
2. JavaScript has cross-platform support from all popular browsers while VBScript is supported MS IE only. VBScripters would thus loose a sizable audience.
3. One of the most significant issues with JavaScript is that there were different releases of the language since its inception (version 1.0). Similarly, different versions of browsers exist on users machines. Therefore, code written for one version may not necessarily work on another. More testing would be necessary thus, development time increases.
4. JavaScript is case sensitive but VBScript is not this would not be prone to as many syntax errors.<
5. 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.

if you want to know some more ,

Javascript -vs- VBScript, pros and cons compared,date,2005-06-13.aspx

Comparing JavaScript and VBScript - K Pravin Kumar Reddy replied to chitanya chitanya on 18-Jan-07 09:39 AM

Comparing JavaScript and VBScript

Although the World Wide Web is very powerful for displaying information, traditional Web pages are static and cannot interact with users in the way that most computer programs do. The birth of client-side, browser-based scripting engines such as JavaScript and Visual Basic Scripting Edition (VBScript) has allowed for the creation of actual client applications that are automatically downloaded with the content of a Web page when it is accessed. The scripts can then execute on the client machine as traditional programs do or in reaction to user manipulation.

Two competing scripting standards, Visual Basic Script and JavaScript, have been introduced to provide client-side execution. The parent company of each engine has designed its scripts to be optimal for a particular set of tasks. JavaScript, created by Netscape Communications Corp., seeks to be the standard for the Internet and the primary automation language used to control and activate Java applications. Microsoft has created VBScript to focus on the corporate Intranet, as a tool in providing client/server solutions. VBScript is specifically targeted at applications based on Web technology, and classic Visual Basic is geared toward traditional client/server solutions.

In this article, I examine both implementations (VBScript included with Internet Explorer 3.0 and JavaScript included with Netscape Navigator 3.0), their strengths and weaknesses, how they are used in development, and some of their target applications. Choosing a scripting engine depends on your intended task because both engines excel in the areas they are targeting.


Differences - mohd khan replied to chitanya chitanya on 02-Apr-07 01:49 AM

java script is supported across browsers.vb script is supported for IE only.

java script is case sensitive.vbscript is not case sensitive.

java script is founded by sun microsystems while vb script is founded microsoft

diff b/w css and dhtml - gomathi pappu replied to chitanya chitanya on 01-Oct-08 07:18 AM

i want the difference between css and Dhtml.. anybody help me for my viva voice

diff js vs vbs - gomathi pappu replied to chitanya chitanya on 01-Oct-08 07:29 AM

especially VBScript and Java script and difference in their syntax...


JScript and Javascript


Example (print 1 to 10 on a web page)

<html> <body>
for (i=1; i<=10; i++)
<html> <body>
for i = 1 to 10
 Response.Write(i & "<br>")

Script Tags

<%      %>

<%=  return expression %>

<%       %>

<%=return expression %>

End of statement

End of line or optional semicolon

End of line

Comments JScript comment
/* This is a 
   Jscript Comment */
' VBScript comment


No prefix

No prefix

Need to declare variables?

Optional. Error if variable not initialised when used.

var AVAR

Optional. Error if variable not initialised when used.


Loosely Typed Variables




Yes for variables and reserved words



Delimited by single-quotes or double-quotes.

Delimited by double-quotes.

String Concatenation

The + (plus) symbol.

s = 'A' + 'B'

The & (ampersand) symbol.

s = "A" & "B"

String Evaluation



Common string constants

Line feed: "\n"
Carriage return: '\r'

Line feed: vbLf
Carriage return: vbCr

HTML encoding functions

escape(str) All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding

unescape(str) inverse of escape

Requires ASP Server object (and consequent COM overhead).

Server.HMTLEncode( ) Similar to PHP's htmlspecialchars.

Server.URLEncode( ) Similar to PHP's urlencode.


Regular Expressions


if (str.match(/php/i))
  Response.Write("php found")

Use COM object RegExp. Only available with the latest versions of VBScript (5.5 or later).


adate = new Date();
adate = new Date(2000,1,30)


Dates are formated using the current locale configured in the control panel, so you have to hand-code date formatting or change your locale.

adate = Now
date= CDate('2000-1-30')

Dates are formated using the current locale configured in the control panel, so you have to hand-code date formatting or change your locale.


Declare with
avar = new Array(1,'two');

For indexing use [ ]. Arrays begin with zero element.

Use array.length to get size of array.

Declare with
DIM avar(2)

For indexing use ( ). Arrays begin with zero element.


Associative Arrays


avar = new Array();
avar['newton'] = 'isaac';

Not built into the language, but can simulated using the Dictionary object (which is not thread-safe in VBScript 5.0).

True and False

Has constants true and false.

Empty strings and zero will evaluate to false.

Has constants true and false.

Unlike PHP and JScript, zero does not evaluate to false.


== true if equal
!= not equal



=== true if equal & same type

!== not identical

JScript does not have the 0/false problem.

= true if equal
<> not equal

Assignment statements

Allows C style shortcut assignments. For example, to append a string to a variable:

avar += 'append to end';

No shortcut assignments.

Sending HTML to Browser



If statements

Similar to PHP and C.

if len(avar) = 0 then
  avar = "abc"
  avar = avar & "end"

While statements

while (a > 0) a -= 1;
while a > 0
  a = a - 1

For loops

for (i=0,m=9; i<m; i++) {
for i=1 to 100


switch(aColor) { 
case 'red': 
case 'green': 
default: do3; break;
select case aColor
case "red"
case "green"
case else
end select

Re :: Difference Between Javascript & VBScript - SP replied to chitanya chitanya on 25-Feb-09 03:54 PM

VBScript vs JavaScript

VBScript allows explicit destruction of objects, whereas JavaScript is a "garbage collected" language.

VBScript allows you to define public/private members in classes, whereas in JavaScript, all members are (basically) public.

VBScript supports the "SafeArray" data type, whereas JavaScript doesn't. MS JScript adds the Enumerator() object to compensate for this.

VBScript supports passing "by reference" whereas JavaScript only allows passing "by value."

JavaScript has a more concise syntax, whereas VBScript is often extremely verbose.

JavaScript allows you to supply a dynamic number of arguments to a function, whereas VBScript forces you to send the exact number of arguments specified in the function (or sub) declaration.

JavaScript is supported in many web browsers, whereas VBScript is only supported in Internet Explorer.

JavaScript allows you to add members to existing objects (such as String, Number, etc) whereas VBScript does not treat strings, numbers, etc. as objects, and thus does not allow new methods to be defined.

Hope this helps.