Home >Web Front-end >Front-end Q&A >What is the difference between ajax and nodejs
Difference: 1. Ajax is a client-side technology, while Node.js is a JavaScript running environment and a development platform; 2. Node does not execute in the browser, but Ajax executes in the browser; 3 , node mainly provides background services, and ajax is mainly used to request and send data for front and back data.
The operating environment of this tutorial: windows7 system, nodejs version 12.19.0, DELL G3 computer.
The difference between ajax and nodejs
Difference 1:
Ajax (Asynchronous Javascript and XML (short for ) is a client-side technology typically used to update page content without refreshing it.
Node.js is server-side Javascript. It is a JavaScript running environment based on the Chrome V8 engine. It is a development platform that allows JavaScript to run on the server side.
Difference 2:
Node.js is not executed in the browser, but is executed by the server. And Ajax is executed in the browser.
Difference 3:
node mainly provides background services, while ajax is mainly used to request and send data for front and backend data.
Introduction to AJAX
AJAX is "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML). AJAX is not an abbreviation, but was created by Jesse A term coined by James Gaiiett to refer to a web development technology for creating interactive web applications.
Ajax combines Java technology, XML, JavaScript and other programming technologies, which allows developers to build Web applications based on Java technology and breaks the management of page reloading.
Ajax technology uses asynchronous HTTP requests to transfer data between the Browser and the Web Server, so that the Browser only updates part of the web page content without reloading the entire web page.
Ajax is a Web application development method that uses client-side scripts to exchange data with a Web server. In this way, the Web page can be dynamically updated without interrupting the interaction process and re-editing it. Using Ajax, users can create direct, highly available, richer, and more dynamic Web user interfaces that are close to native desktop applications.
Introduction to nodejs
Node.js is a JavaScript running environment based on the Chrome V8 engine. It is a JavaScript A development platform that runs on the server side, it makes JavaScript a scripting language on par with server-side languages such as PHP, Python, Perl, and Ruby.
Node optimizes some special use cases and provides alternative APIs to make V8 run better in non-browser environments. The V8 engine executes Javascript very quickly and has very good performance.
Node is a platform based on the Chrome JavaScript runtime, used to easily build web applications with fast response speed and easy expansion. Node uses an event-driven, non-blocking I/O model to be lightweight and efficient, making it ideal for running data-intensive real-time applications on distributed devices.
What kind of applications is Node.js suitable for developing?
Good at I/O, not good at calculation. Because Node.js is best at task scheduling, if your business involves a lot of CPU calculations, it actually means that this calculation blocks the single thread, and it is not suitable for Node development.
Node.js is very suitable when the application needs to handle a large amount of concurrent I/O and does not require very complex processing within the application before sending a response to the client. Node.js is also very suitable for working with web sockets to develop real-time interactive applications with long connections.
Node.js is not an independent language. Unlike PHP, JSP, Python, Perl, and Ruby, which are both languages and platforms, Node.js uses JavaScript for programming and runs on a JavaScript engine. (V8).
For more node-related knowledge, please visit: nodejs tutorial! !
The above is the detailed content of What is the difference between ajax and nodejs. For more information, please follow other related articles on the PHP Chinese website!