What are the differences between javascript and vbscript

青灯夜游
Release: 2021-11-03 17:27:16
Original
3391 people have browsed it

Differences: 1. There are two types of JS comments, single-line comments "//" and multi-line comments "/* */"; Vbscript has only one type, using single quotes "'". 2. JS can use var, let and const to declare variables; Vbscript can only use Dim. 3. JS is case-sensitive, Vbscript is not, etc.

What are the differences between javascript and vbscript

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

The difference between JavaScript and VBScript:

1. Differences in comments

Javascript comments are 2 types, namely single-line comments // and multi-line comments /* */

Vbscript comments are commented with single quotes '

2. Differences in declaring variables

There are three ways to declare variables in JavaScript, namely using the var, let and const keywords.

Vbscript is defined with Dim, but it must be declared first and then assigned

For example:

dim nnumber
number=12
Copy after login

3. Syntactic differences

JavaScript syntax is similar to the C programming language and is a case-sensitive language.

VBScript syntax is similar to visual basic because it is developed based on Visual Basic and it follows the visual basic syntax for application development. It is a case-insensitive language.

4. Browser support

JavaScript is the default scripting language for most web browsers and supports almost all web browsers because it supports cross-platform. It can read and modify HTML elements from IE browsers, and can automate ActiveX components in the browser.

VBScript is not the default scripting language for browsers as it only supports Internet Explorer or Microsoft Edge browsers. We need to specify it as a scripting language. It can read and modify HTML elements from IE browser, and can automate ActiveX components in IE browser.

5. Function support

JavaScript is an object-oriented scripting language. It is not perfectly object-oriented and does not support the concept of inheritance. It supports powerful object usage and class declaration for later creation of objects, and does not support programs.

VBScript is also a partially object-oriented scripting language. It does not support the concept of inheritance, usage of objects, object creation, user-defined classes. It supports reusable functions and subroutines.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of What are the differences between javascript and vbscript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template