JavaScriptフレームワーク:jQuery(JSON Ajax)

7233 ワード

前に書いてある私の理解
JSONはJavaScriptオブジェクト表示法であり、データ交換フォーマットとしてJSON.stringify()とJSON.parse()はJSオブジェクトと文字列間の変換を実現する.JavaScriptのサブセットで、JavaScriptのすべての値を表すことはできません.オブジェクト、配列、文字列、無限大の数字、true、false、nullをサポートし、JSONをシーケンス化することができます.stringify()(JSオブジェクトを文字列に変換)とJSONを復元します.parse()(文字列がJSオブジェクトに変換されます).
Webアプリケーションで、Webブラウザがウィンドウやフォームの内容を再ロードすることがない場合、スクリプトはどのようにWebブラウザとサーバ間の通信を実現しますか?Ajaxというスクリプトを使ってHTTPを操作するWebアプリケーションアーキテクチャでは、クライアントがサーバからデータを「引く」.Ajaxを実現する大きな方法はいろいろありますが、(src属性)、(src属性)伝送プロトコルの上でAjax技術を実現できますが、ブラウザでサポートされているXMLhttpResponseオブジェクトを借りて、スクリプトでHTTPを操作するAPIを定義しています.HTTPはそれぞれ独自のフォーマットを求めて応答してください.ここでも<をサポートします.strong>JSON</strong>フォーマット符号化の要求データ.</p>
<p>JavaScriptにはドキュメントの内容、表示、イベント(HTML/CSS/Event)を処理する属性や方法がたくさんあり、各ブラウザと互換性を持つために、これらの属性や方法をカプセル化したフレームワークやクラスライブラリが生成されています.ここでは、最もポピュラーなjQueryを紹介します.また、jQueryにも<が内蔵されています.strong>Ajax</strong>ツールは、Webページをリフレッシュせずにリクエスト応答を実現します.</p>
<hr>
<h3>JSON wiki</h3>
<p>In computing, JSON (JavaScript Object Notation) is an open-standard format that uses human-readable text to transmit data objects consisting of <strong>attribute–value pairs</strong>. <strong>It is the most common data format used for asynchronous browser/server communication, largely replacing XML, and is used by AJAX.</strong></p>
<p>JSON is a <strong>language-independent</strong> data format. It was <em>derived from JavaScript</em>*, its syntax is (mostly) a <strong>subset</strong> of the language, but as of 2017 many programming languages include code to generate and parse JSON-format data. The official Internet media type for JSON is <em>application/json</em>. JSON filenames use the extension <em>.json</em>.</p>
<p>Douglas Crockford originally specified the JSON format in the early 2000s; two competing standards, RFC 7159 and ECMA-404, defined it in 2013.</p>
<p>JSON's applications:AJAX<br> Asynchronous JavaScript and JSON (or AJAJ) is <strong>dynamic web page methodology</strong> , but instead of XML, JSON is the data format. AJAJ is a <strong>web development technique</strong> that provides for the ability of a webpage to request new data after it has loaded into the web browser. Typically it renders new data from the server in response to user actions on that webpage. For example, what the user types into a search box, client-side code then sends to the server, which immediately responds with a drop-down list of matching database items.<br> The following JavaScript code is an example of** a client using XMLHttpRequest to request data in JSON format from a server**.</p>
<pre><code>var my_JSON_object;
var http_request = new XMLHttpRequest();
http_request.open("GET", url, true);
http_request.responseType = "json";
http_request.onreadystatechange = function () {
var done = 4, ok = 200;
if (http_request.readyState === done && http_request.status === ok) {
my_JSON_object = http_request.response;
}
};
http_request.send(null);
</code></pre>
<h3>XMLHttpRequest wiki</h3>
<p>XMLHttpRequest (XHR) is an <strong>API</strong> in the form of an object whose methods <strong>transfer data between a web browser and a web server</strong>. The object is <strong>provided by the browser's JavaScript environment</strong>. Particularly, <strong>retrieval of data from XHR for the purpose of continually modifying a loaded web page is the underlying concept of Ajax design</strong>. Despite the name, XHR can be used with protocols other than HTTP and data can be in the form of not only XML,[1] but also JSON,[2] HTML or plain text.[3]</p>
<h3>Ajax wiki</h3>
<p>Ajax (also AJAX; asynchronous JavaScript and XML) is a set of Web development techniques using many Web technologies on the <strong>client side</strong> to create <strong>asynchronous Web applications</strong>. With Ajax, Web applications can send data to and retrieve from a server asynchronously (in the background) <strong>without interfering with the display and behavior of the existing page</strong>. By decoupling the data interchange layer from the presentation layer, Ajax allows for Web pages, and by extension Web applications, to change content dynamically <strong>without the need to reload the entire page</strong>. In practice, modern implementations commonly <strong>substitute JSON for XML due to the advantages of being native to JavaScript</strong>.<br> Ajax is not a single technology, but rather a group of technologies. <strong>HTML and CSS</strong> can be used in combination to mark up and style information. The <strong>DOM</strong> is accessed with JavaScript to dynamically display – and allow the user to interact with – the information presented. <strong>JavaScript and the XMLHttpRequest object provide a method for exchanging data asynchronously between browser and server to avoid full page reloads.</strong><br> </p>
<div class="image-package">
<div class="image-caption"></div>
</div>
<p></p>
<hr>
<h3>jQuery wiki</h3>
<p>jQuery is a cross-platform <strong>JavaScript library</strong> designed to simplify the client-side scripting of HTML. It is free, open-source software using the permissive MIT license. Web analysis indicates that it is the most widely deployed JavaScript library by a large margin.</p>
<p>jQuery's syntax is designed to make it easier to** navigate a document, select DOM elements, create animations, handle events, and develop Ajax applications**. jQuery also provides capabilities for developers to create <strong>plug-ins</strong> on top of the JavaScript library. This enables developers to create abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets.</p>
<p><strong>Usage</strong></p>
<ol>
<li>The jQuery library is a single JavaScript file containing all of its common DOM, event, effects, and Ajax functions. It can be included within a Web page by linking to a local copy or to one of the many copies available from public servers.</li>
</ol>
<pre><code><script src="jquery.js">

## 2017.4.1 http://jquery.com/download/

  1. jQuery has a content delivery network(CDN)(コンテンツ配信ネットワーク)hosted by MaxCDN.Google and Microsoft host it as well.


## 2017.4.1 https://code.jquery.com