Solved

difference between Javascript and VBScript in client

Posted on 2002-04-22
9
8,615 Views
Last Modified: 2012-06-21
Hi!Every One!
  Wneh I write client script ,I may adopt javascript(*.js) and Vbscript(*.vbs),I want to know the differenc between javascript and vbscript in client!
  please explain it for me!thanks!
 
  Thanks!!!
0
Comment
Question by:oceanyang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 30

Accepted Solution

by:
third earned 100 total points
ID: 6961945

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.

0
 
LVL 30

Expert Comment

by:third
ID: 6961950
recommendation: use javascript

0
 
LVL 5

Expert Comment

by:dgorin
ID: 6961957
Also in the client, Netscape doesn't support vbscript (without some kind of plugin anyway).  Follow Third's recommendation and use JavaScript in client-side code.

Serverside asp code is often done in vbscript, which is fine since the server has no compatibility issues with the client browser to worry about.



0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 20

Expert Comment

by:Silvers5
ID: 6961970
this is the most important comment:
>JavaScript is supported in many web browsers, whereas VBScript is only supported in Internet Explorer.


thus crossbrowser compatibility..
besides you will learn the java language syntax this way and can later easily move to java by assimilating OOP
0
 
LVL 2

Expert Comment

by:kahwoo
ID: 6962029
third what do u mean by this ?

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


regards
kahwoo
0
 
LVL 9

Expert Comment

by:AlfaNoMore
ID: 6962333
#### VBScript

Set newObj = CreateObject("X.Y")

Set newObj = Nothing


#### JavaScript

var newObj = new ActiveXObject("X.Y");

var newObj = null;


I guess this is what third means?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6962624
AlfaNoMore...not quite.   What happens in a 'garbage collected' language, is that every so often (user/developer has no control over how often), the language engine goes thorugh all of the open object references and determines which ones are no longer being actively used (known as 'garbage'), and those that are not active are then destroyed, releasing the memory back to the heap.  VBScript uses "reference counting", so that when an instance of a class is created, an internal counter(calle the RefCount) is incremented by one, and when a reference is destroyed, the RefCount is decreased by one.  When the RefCount of references to an object reaches 0, then the object is destroyed, and the memory is released.

Arthur Wood
0
 
LVL 30

Expert Comment

by:third
ID: 6964369
well said Arthur. there's nothing more i can say. thanks for explaining it for me. ;-)
0
 
LVL 58

Expert Comment

by:Gary
ID: 8823974
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Answer by third
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question