W e l c o m e    t o    [ www.mauspfeil.net ] Datum: 08.01.2009, 19:57 Uhr

Dictionary of Meaning


<<Back
Please select a letter:
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | 0-9
Search:
Shopping-Bestseller-Search:    
 Click here for Shopping

Google

JSON

*** Shopping-Tip: JSON

'''JSON''' (pronounced as International Phonetic Alphabet IPA {{IPA|[dʒeɪsən]}}, or like the English given name "Jason"), which stands for "JavaScript '''J'''ava'''S'''cript Object (computer science) '''O'''bject '''N'''otation", is a lightweight computer data interchange format. '''JSON''' is a subset of the object literal notation of JavaScript but its use does not require XML. JSON's simplicity has resulted in its widespread use, especially as an alternative to XML in Ajax (programming) Ajax. One of the claimed advantages of '''JSON''' over XML as a data interchange format in this context is that it is much easier to write a JSON parser. In JavaScript itself, JSON can be parsed trivially using the eval() procedure. This was important for the acceptance of JSON within the AJAX programming community because of JavaScript's ubiquity among web browsers. In practice, arguments regarding ease of parser development or parser performance are rarely relevant due to security concerns regarding the use of eval() and the rise of built-in XML processing features in modern web browsers. For that reason JSON is typically used in environments where the size of the data stream between client and server is of paramount importance (hence its use by Google, Yahoo, etc. which serve millions of users), where the source of the data can explicitly be trusted, and where the loss of fast access to client-side XSLT processing for data manipulation or UI generation is not a consideration. While JSON is often positioned "against" XML, it's not uncommon to see both JSON and XML used in the same application. For example, a client-side application which integrates Google Maps data with SOAP weather data requires support for both data formats. There is growing support for JSON through the use of lightweight third-party packages. The list of supported languages includes ActionScript, C programming language C, C Sharp C#, ColdFusion, E programming language E, Java programming language Java, JavaScript, ML programming language ML, Ocaml Objective CAML, Perl, PHP, Python programming language Python, Rebol, Ruby programming language Ruby, and Lua programming language Lua. In December 2005 Yahoo! began supporting JSON as an option for some of its [http://developer.yahoo.net/common/json.html Web services]. JSON does not provide support for object references.

Using JSON
In theory, it is trivial to parse JSON in JavaScript using JavaScript's built in eval() procedure. For example: myObject = eval('(' + json_data + ')'); In practice, however, security and other considerations generally preclude using ''eval'' on raw data and a separate JavaScript parser would have to be used to ensure security. The [http://www.JSON.org/json.js open-source parser] provided by JSON.org uses eval() in its parse function, guarding it with a regular expression so that the eval function only sees safe expressions. One JSON data access example via XMLHTTP XMLHTTPRequest is: var http_request = new XMLHttpRequest(); var url = "http://example.net/this/is/a/fake/url/"; // This URL should give us JSON data. // Download the JSON data from the server. http_request.onreadystatechange = handle_json; http_request.open("GET", url, true); http_request.send(null); function handle_json() { if (http_request.readyState == 4) { if (http_request.status == 200) { var json_data = http_request.responseText; var the_object = eval("(" + json_data + ")"); } else { alert("There was a problem with the URL."); } http_request = null; } } Note that the use of XMLHttpRequest in this example is not cross-browser although syntax syntactic variations are available on Internet Explorer, Opera (web browser) Opera, Safari (web browser) Safari, and Mozilla-based browsers. Browsers can also use (hidden)