Open In App

Difference between JavaScript and VBScript

Last Updated : 27 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

JavaScript and VBScript are both scripting languages used to automate tasks and enhance web pages. JavaScript is widely supported across all modern browsers and platforms, making it the preferred choice for web development. In contrast, VBScript is primarily used in Internet Explorer and Windows environments for automation and server-side scripting in legacy systems.

JavaScript

JavaScript is a lightweight and object-oriented scripting language used to create dynamic HTML pages with interactive effects within a webpage. It is an interpreted scripting language and its code is run in a web browser only. It is also called a browser’s language and can be used for client-side developments as well as server-side developments. It was developed by Brendan Eich at Netscape and was first released in 1995. 

Example: To demonstrate the JavaScript code.

JavaScript
<script type="text/javascript"> 
    document.write("Hello geeks, greeting from GeeksforGeeks") 
</script>

VBScript

VBScript is an active scripting language introduced by Microsoft. It is developed based on Visual Basic and is also called a Visual Basic scripting language. It does not support all browsers, supports only Internet Explorer. It is generally used in Microsoft environments and uses a component object model to access system objects and variables of the environment. 

Example: To demonstrate the code of the VBScript.

JavaScript
<script type="text/vbscript"> 
    document.write("Hello geeks, greeting from GeeksforGeeks") 
</script> 

Difference between JavaScript and VBScript 

S.No.JavaScriptVBScript
1.It was developed by Netscape.It was developed by Microsoft.
2..It does job as a client-side scripting language.It does job as both server-side and client-side scripting language.
3.It supports all web browsers and it is a default scripting language in mostly browsers.It does not support all browsers, supports only Internet Explorer.
4.It uses the same operator for various operations.While it uses different operators for various operations.
5.It uses curly braces for declaration of functions.It uses Function and End function for declaration of functions.
6.JavaScript file has the file extension “.js”.VBScript file has the file extensions “.vbs” or “.vba”. 
7.It is simpler and easier to learn JavaScript.It is difficult for beginners to learn VBScript as compared to JavaScript.
8.It is a case sensitive language.It is not a case sensitive language.
10.It’s syntax  is derived from C language.It’s syntax is derived from Visual BASIC syntax.


Next Article

Similar Reads