Home >Web Front-end >Front-end Q&A >Is javascript a framework or a library?
Javascript is not a framework or a library, but a scripting language. JavaScript, referred to as js, is a lightweight, interpreted or just-in-time compiled scripting language with function priority. It is a programming language widely used on the client. It is often used to add a variety of dynamic functions to web pages. Provide users with a smoother and more beautiful browsing effect; and the Javascript framework (library) refers to the programming framework (library) based on the Javascript language.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
Javascript is not a framework or a library, but a scripting language.
JavaScript language introduction
JavaScript ("JS" for short) is a lightweight, interpreted language with function priority. Or a just-in-time compiled scripting language. Although it is famous as a scripting language for developing Web pages, it is also used in many non-browser environments. JavaScript is based on prototype programming, a multi-paradigm dynamic scripting language, and supports object-oriented, imperative, declarative, and functional programming paradigm.
JavaScript is a dynamically typed, weakly typed, prototype-based language. Its interpreter is called the JavaScript engine, which is part of the browser and is widely used in client-side scripting languages. It was first used on HTML web pages to add dynamic functions to HTML web pages.
JavaScript is a network scripting language that has been widely used in Web application development. It is often used to add various dynamic functions to web pages to provide users with smoother and more beautiful browsing effects. Usually JavaScript scripts realize their functions by embedding them in HTML.
JavaScript is a cross-platform interpreted language that does not require pre-compilation and can run under various operating systems.
The JavaScript script language does not depend on the operating system and only requires browser support. Therefore, a JavaScript script can be used on any machine after being written, provided that the browser on the machine supports the JavaScript script language. JavaScript has been supported by most browsers, so it can run on a variety of platforms (such as Windows, Linux, Mac, Android, iOS, etc.).
Simply put, JavaScript depends on the browser itself and has nothing to do with the operating environment. As long as the computer can run the browser and the browser supports JavaScript, it can be executed correctly. But different browsers and different versions of the same browser support JavaScript differently (browser compatibility).
Unlike server-side scripting languages, such as PHP and ASP, JavaScript is mainly used as a client-side scripting language to run on the user's browser and does not require server support. Therefore, in the early days, programmers preferred JavaScript to reduce the burden on the server, but at the same time it also brought about another problem, security.
JavaScript can be used in various fields of Web development, such as:
Web application development: The web pages we browse in daily life are composed of HTML, It is composed of CSS and JavaScript. Through JavaScript, the styles of elements in the web page can be updated in real time, and the interaction between people and the web page can be realized (such as monitoring whether the user clicks the mouse or presses a certain button, etc.), and can also Add some cool animations;
Mobile application development: In addition to web application development, JavaScript can also be used to develop applications on mobile phones or tablets, and we can also Make development easier with the help of some excellent frameworks (such as React Native);
Web games: Those small games we have played on the web can all be implemented using JavaScript;
Back-end Web application development: In the past, we used JavaScript to develop the front-end part of Web applications, but with the emergence of Node.JS (a JavaScript runtime environment), JavaScript It can also be used to develop the back-end portion of web applications.
JavaScript framework
Javascript framework refers to a programming framework based on the Javascript language.
JavaScript frameworks are now being integrated into their own web and mobile applications.
The development direction of software is shifting towards the client. Building back-end APIs and rich front-end clients is a big trend, and most of these are written in JavaScript frameworks. This seems to be a trick the developers are using. If you use the API when developing the front-end interface, you will be more familiar with the API and you will have a clear understanding of your work content. Applying this technology to writing clients makes it very easy to write top-notch iPhone or Android applications.
Before the advent of JavaScript frameworks, developers could only perform jQuery operations on the page. This approach can easily cause confusion for developers about coding operations, and is not easy to manage. Backbone was the original frontrunner, providing a basic structure and organization alongside developer-friendly frameworks such as Angular and Ember. Nowadays, it has been favored by many projects. We often overlook the professional background of developers, which may lead them to discover a popular framework that feels very intuitive and makes the JavaScript framework easier to understand.
Purpose of JavaScript framework:
Building a website
Application front-end development
Application backend development
Application hybrid development
E-commerce application
Build modular scripts such as Node.js
Update the DOM manually
Automatically using templates and two-way binding Perform repetitive tasks
Develop video games
Create image carousels
Test code and Debugging
Module combination
Common javascript frameworks (libraries) include:
1. Front-end UI framework
1. Bootstrap framework, which comes from Twitter, is currently the most popular front-end framework. It has the characteristics of simple and intuitive front-end development.
2. EasyUI framework. EasyUI is a collection of user interface plug-ins based on jQuery, Angular., Vue and React. By using easyui, you don't need to write a lot of code. You only need to write some simple HTML tags to define the user interface.
...
two. Front-end framework
1, Node.js framework. Node.js is an event-driven I/O server-side JavaScript environment based on Google's V8 engine. The V8 engine executes Javascript very quickly and has very good performance.
2. Vue.js framework. Vue.js is a very popular JavaScript MVVM library at the moment. It is built with data-driven and component-based ideas. Compared with Angular.js, Vue.js provides a simpler and easier-to-understand API.
3. React framework. React originated from Facebook's internal project and was used to build the Instagram website. It is a JAVASCRIPT library used to build user interfaces.
4. Angular.Js framework. The angular.Js framework is an excellent front-end JS framework that has been used in many Google products. AngularJS has many features, the most core of which are: MVC (Model–view–controller), modularization, automated two-way data binding, and semantic tags.
5. Gatsby
Gatsby can help you develop websites and applications with good performance using React. This is an open source and free front-end JS framework.
...
Expand your knowledge:Some useful JavaScript tools
Slick
Slick is a useful JS tool for your carousel needs. Its containers are responsive and scalable. Its features include CSS3 support, sliding, mouse dragging, full accessibility, infinite loop, autoplay, lazy loading, and more.
Babel
Babel is a free and open source JS compiler that can be used to convert new JS features to run older JS standards. The plugin is also used for syntax conversions not supported by older versions. It provides polyfills to support missing functionality in some JS environments.
iziModal
iziModal is an elegant, lightweight, flexible and responsive modal plugin for use with jQuery. It is useful to use pop-ups to notify the user of certain information or to ask for information. It's easy to use and has many customizations.
ESLint
Using ESLint it is easy to find errors and fix them in JS code. It statistically analyzes code to quickly catch syntax errors, command line style issues, etc. and fix them automatically.
Shave
Shave is a zero-dependency JS plugin that allows you to truncate text inside an HTML element by setting a maximum height so that it fits exactly within the element. It also stores some extra original text in the hidden element to ensure you don't lose it.
Webpack
Webpack is a tool for bundling JS modules for modern applications. You can write code and use it to bundle assets sensibly while keeping your code clean.
[Related recommendations: javascript video tutorial, programming video】
The above is the detailed content of Is javascript a framework or a library?. For more information, please follow other related articles on the PHP Chinese website!