gpt4 book ai didi

ajax - 何时将 Ajax 与 Json 用于 Javascript 事件?

转载 作者:IT老高 更新时间:2023-10-28 12:52:37 24 4
gpt4 key购买 nike

我对 Ajax 不是很熟悉,但我经常听到有人提到 Json 作为某种竞争选项。有没有规定何时使用一种与另一种?

我想在我的应用程序中处理 Javascript 事件并从应用程序动态更新前端,但我不确定是否需要为此使用 Ajax 或 Json。

最佳答案

AjaxJSON是非常不同的东西。

来自 Ajax (programming) :

Ajax, sometimes written as AJAX (shorthand for asynchronous JavaScript and XML), is a group of interrelated web development techniques used on the client-side to create interactive web applications or rich Internet applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. The use of Ajax has led to an increase in interactive animation on web pages and better quality of Web services thanks to the asynchronous mode. Data is retrieved using the XMLHttpRequest object. Despite the name, the use of JavaScript and XML is not actually required, nor do the requests need to be asynchronous.

来自 Introducing JSON :

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

关于ajax - 何时将 Ajax 与 Json 用于 Javascript 事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/939211/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com