翻訳と辞書
Words near each other
・ JSmooth
・ JSN
・ JSO
・ JSOL
・ JSON
・ Json (rapper)
・ JSON Streaming
・ JSON Web Signature
・ JSON Web Token
・ JSON-LD
・ JSON-RPC
・ JSON-WSP
・ Json2Ldap
・ JSONiq
・ JsonML
JSONP
・ Jsoup
・ JSP
・ JSP model 1 architecture
・ JSP model 2 architecture
・ JSP Records
・ JsPHP
・ Jspx
・ Jspx-bay
・ JSR
・ JSR 168 Portlet Catalog
・ JSR 250
・ JSR 53
・ JSR 94
・ Jsreport


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

JSONP : ウィキペディア英語版
JSONP

JSONP (or JSON with Padding) is a technique used by web developers to overcome the cross-domain restrictions imposed by browsers to allow data to be retrieved from systems other than the one the page was served by.
== How it works ==
To see how this technique works, first consider a URL request that returns JSON data. A JavaScript program might request this URL via XMLHttpRequest, for example. Suppose the user ID of a person Foo is 1234. A browser requesting the URL http://server.example.com/Users/1234, passing the ID of 1234, would receive data (usually dynamically generated) similar to:

Here, an HTML <script> element specifies for its src attribute a URL that returns JSON:



The browser will, in order, download the script file, evaluate its contents, interpret the raw JSON data as a block, and throw a syntax error. Even if the data were interpreted as a JavaScript object literal, it could not be accessed by JavaScript running in the browser, since without a variable assignment, object literals are inaccessible.
In the JSONP usage pattern, the URL request pointed to by the src attribute in the <script> element returns JSON data, with JavaScript code (usually a function call) wrapped around it. This "wrapped payload" is then interpreted by the browser. In this way, a function that is already defined in the JavaScript environment can manipulate the JSON data. A JSONP response payload might look like this:

myResponseFunction();

The function call to myResponseFunction() is the "P" of JSONP—the "padding" around the pure JSON, or according to some〔(【引用サイトリンク】title=Experimental RDF result set to JSON translator )〕 the "prefix".
Note that for JSONP to work, a server must reply with a response that includes the JSONP function. JSONP does not work with JSON-formatted results. The JSONP function invocation that gets sent back, and the payload that the function receives, must be agreed-upon by the client and server.
By convention, the browser provides the name of the callback function as a named query parameter value, typically using the name jsonp or callback as the named query parameter field name, in its request to the server, e.g.,



In this example, the received payload would be:

parseResponse();


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「JSONP」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.