Home >Web Front-end >Front-end Q&A >What is the difference between ajax and JavaScript

What is the difference between ajax and JavaScript

青灯夜游
青灯夜游Original
2021-04-08 16:43:242913browse

JavaScript is a scripting language that is executed on the client. It is often used to add a variety of dynamic functions to web pages to provide users with a smoother and more beautiful browsing effect. Ajax is a development technology for creating interactive web applications based on JavaScript. Its main purpose is to provide asynchronous refresh.

What is the difference between ajax and JavaScript

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

JavaScript and Ajax are languages ​​and technologies, and there are essential differences between them. Let's introduce JavaScript and Ajax to you.

JavaScript

The abbreviation of javaScript is JS, a scripting language widely used in client-side web development, often used to create HTML web pages Add dynamic functions (programs written by it can be embedded into HTML or XML pages and interpreted and executed directly in the browser).

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.

Components:

Core (ECMAScript), Document Object Model (DOM), Browser Object Model (BOM)

Main functions

1. Embed dynamic text in HTML pages.

2. Respond to browser events.

3. Read and write HTML elements.

4. Validate data before it is submitted to the server.

5. Detect the visitor’s browser information. Control cookies, including creation and modification.

6. Server-side programming based on Node.js technology.

[Recommended learning: javascript advanced tutorial]

Ajax

AJAX means "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), AJAX is not an abbreviation, but a term coined by Jesse James Gaiiett, which refers to a web development technology for creating interactive web applications.

After using ajax technology, when the page needs to communicate with the server, it can only refresh part of the content or data in the page instead of refreshing the entire page, which reduces the bandwidth pressure between the browser and the server. Improved page response efficiency.

Composition:

  • Representation based on XHTML and CSS standards;

  • Use Document Object Model Perform dynamic display and interaction;

  • Use XML and XSLT for data interaction and operation;

  • Use XML HttpRequest for asynchronous communication with the server;

  • Bind everything using JavaScript.

Description:

  • Ajax combines Java technology, XML and JavaScript and other programming technologies, allowing developers to Build web applications based on Java technology and break the management using page reloads.

  • 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.

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

The above is the detailed content of What is the difference between ajax and JavaScript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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