background preloader

JSON

JSON
JSON (/ˈdʒeɪsən/ JAY-sən),[1] or JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML. Although originally derived from the JavaScript scripting language, JSON is a language-independent data format. Code for parsing and generating JSON data is readily available in many programming languages. The JSON format was originally specified by Douglas Crockford. It is currently described by two competing standards, RFC 7159 and ECMA-404. History[edit] Although JSON was originally based on a non-strict subset of the JavaScript scripting language (specifically, Standard ECMA-262 3rd Edition—December 1999[8]) and is commonly used with that language, it is a language-independent data format. Data types, syntax and example[edit] JSON's basic types are: Data portability issues[edit] Using JSON in JavaScript[edit]

JSON CouchDB Apache CouchDB, commonly referred to as CouchDB, is an open source database that focuses on ease of use and on being "a database that completely embraces the web".[1] It is a NoSQL database that uses JSON to store data, JavaScript as its query language using MapReduce, and HTTP for an API.[1] One of its distinguishing features is multi-master replication. CouchDB was first released in 2005 and later became an Apache project in 2008. Unlike in a relational database, CouchDB does not store data and relationships in tables. Instead, each database is a collection of independent documents. CouchDB implements a form of Multi-Version Concurrency Control (MVCC) in order to avoid the need to lock the database file during writes. Other features include document-level ACID semantics with eventual consistency, (incremental) MapReduce, and (incremental) replication. History[edit] In early 2012, Damien Katz left the project to focus on Couchbase Server.[7] Main features[edit] Document Storage

in JavaScript JavaScript is a general purpose programming language that was introduced as the page scripting language for Netscape Navigator. It is still widely believed to be a subset of Java, but it is not. It is a Scheme-like language with C-like syntax and soft objects. JavaScript was standardized in the ECMAScript Language Specification, Third Edition. JSON is a subset of the object literal notation of JavaScript. In this example, an object is created containing a single member "bindings", which contains an array containing three objects, each containing "ircEvent", "method", and "regex" members. Members can be retrieved using dot or subscript operators. myJSONObject.bindings[0].method // "newURI" To convert a JSON text into an object, you can use the eval() function. eval() invokes the JavaScript compiler. var myObject = eval('(' + myJSONtext + ')'); The eval function is very fast. To defend against this, a JSON parser should be used. var myObject = JSON.parse(myJSONtext, reviver);

Ajax (programming) Ajax is not a single technology, but a group of technologies. HTML and CSS can be used in combination to mark up and style information. The DOM is accessed with JavaScript to dynamically display, and allow the user to interact with, the information presented. JavaScript and the XMLHttpRequest object provide a method for exchanging data asynchronously between browser and server to avoid full page reloads. In 1996, the iframe tag was introduced by Internet Explorer to load or to fetch content asynchronously. In 1998, Microsoft Outlook Web App team implemented the first component XMLHTTP by client script. Google made a wide deployment of standards-compliant, cross browser Ajax with Gmail (2004) and Google Maps (2005).[6] The term "Ajax" was publicly stated on 18 February 2005 by Jesse James Garrett in an article titled "Ajax: A New Approach to Web Applications", based on techniques used on Google pages.[1] get-ajax-data.js: send-ajax-data.php: jQuery example

JSON Tutorial Introduction This is an introductory tutorial on JSON - JavaScript Object Notation. As a web developer, you will find plenty of occassion when you will require applying or working with JSON in your project. The document ends with a list of what you will learn in other tutorials of this series, which is sort of a roadmap of basic things you need to learn for working with JSON and a summary of the points discussed. Ultimately, JSON is used as a data model, but compared to other data models like Relational Database or XML, it has a low learning curve. What is JSON JSON is a lightweight text-based open standard data-interchange format. JSON is often used to serialize and transfer data over a network connection, for example between the web server and a web application. JSON is a standard and is specified on RFC4627 on IETF (International Engineering Task Force). JSON files are saved with .json extension. What JSON looks like We will now look how a typical JSON looks like. Basic Constructs

NoSQL "Structured storage" redirects here. For the Microsoft technology also known as structured storage, see COM Structured Storage. A NoSQL (often interpreted as Not Only SQL[1][2]) database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Motivations for this approach include simplicity of design, horizontal scaling and finer control over availability. The data structure (e.g. key-value, graph, or document) differs from the RDBMS, and therefore some operations are faster in NoSQL and some in RDBMS. History[edit] Eric Evans reintroduced the term NoSQL in early 2009 when Johan Oskarsson of Last.fm wanted to organize an event to discuss open-source distributed databases.[7] The name attempted to label the emergence of an increasing number of non-relational, distributed data stores. There have been various approaches to classify NoSQL databases, each with different categories and subcategories.

JSONP tutorial | JSON Tutorial JSONP Tutorial JSON Tutorial has average rating 6 out of 10. Total 117 users rated. <<Previous Introduction to JSONP In this page We will discuss JSONP, i.e. Same Origin Policy In general, this policy states that, if protocol (like http), Port number (like 80) and host (like example.com) is different from where data is being requested, it should not be permitted. But HTML <script> element is allowed to perform content retrieval from foreign origins. How JSONP works - Step by Step Step 1 - You need to create a callback function. function w3r_callback(data){ console.log(data); } Step 2 - Include a script in your web page which contains the callback function created a step 1 as a parameter. Step 3 - It outputs a script which calls the function and requested data is passed. Note JSONP has nothing to do with Ajax, since it does not use XMLHttpRequest. But if you are using Jquery to do this sort of a job, you got to use Jquery's Ajax utility. Where to use JSONP

jQuery jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML.[2] It was released in January 2006 at BarCamp NYC by John Resig. It is currently developed by a team of developers led by Dave Methvin. Used by over 80% of the 10,000 most visited websites,[3] jQuery is the most popular JavaScript library in use today.[4][5] The set of jQuery core features—DOM element selections, traversal and manipulation—enabled by its selector engine (named "Sizzle" from v1.3), created a new "programming style", fusing algorithms and DOM-data-structures; and influenced the architecture of other JavaScript frameworks like YUI v3 and Dojo. Microsoft and Nokia bundle jQuery on their platforms.[7] Microsoft includes it with Visual Studio[8] for use within Microsoft's ASP.NET AJAX framework and ASP.NET MVC Framework while Nokia has integrated it into the Web Run-Time widget development platform.[9] jQuery has also been used in MediaWiki since version 1.16.[10]

JSON Example JSON Example has average rating 7 out of 10. Total 138 users rated. <<PreviousNext>> Description This document provides you with some JSON Example. If you want to read about various formats JSON can be stored with, you may refer JSON Data Structure. The following is an example of a JSON document. All of the JSON documents used in this document are validated with JSONLint. XML and JSON JSON Document XML Document <dogs> <dog> <category>companion dogs</category> <breed>Chihuahua</breed> </dog> <dog> <category>Hounds</category> <breed>Foxhound</breed> </dog> </dogs> MySQL and JSON The following is a MySQL table. MySQL Table PHP MySQL code to extract data from MySQL table and display as JSON. MongoDB and JSON The following example shows how MongoDB stores data in JSON format. Tumblr API and JSON tumblr.com is messaging platform. Where "web-development-and-seo" is the blog name from where you want to retrieve data.

MongoDB MongoDB (from "humongous") is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in certain types of applications easier and faster. Released under a combination of the GNU Affero General Public License and the Apache License, MongoDB is free and open-source software. First developed by the software company 10gen (now MongoDB Inc.) in October 2007 as a component of a planned platform as a service product, the company shifted to an open source development model in 2009, with 10gen offering commercial support and other services.[1] Since then, MongoDB has been adopted as backend software by a number of major websites and services, including Brave Collective, Craigslist, eBay, Foursquare, SourceForge, Viacom, and the New York Times, among others. Licensing and support[edit]

BSON | JSON tutorial BSON JSON tutorial has average rating 7 out of 10. Total 17 users rated. <<PreviousNext>> Description In this page we have discussed BSON - Binary JSON. What is BSON A single entity in BSON is called as document. Datatypes BSON supports the following basic datatypes : byte : 1 byte, i.e. 8 bits. int32 : 4 bytes i.e. 32-bit signed integer. int64 : 8 bytes i.e. 64-bit signed integer. double : 8 bytes i.e. 64-bit IEEE 754 floating point The following table describes the rest specifications of a BSON document : Implementation There are several BSON libraries available in various languages like - ActionScript,C,C# / .Net, C++ or stand-alone C++, Delphi, Erlang, Factor, Fantom, Go, Haskell, Java, J2ME (work in progress), Lisp, Perl, PHP, Python — with optional C extension, Python 3, Ruby — with optional C extension, Standard ML (SML) MongoDB, which is a NoSQL database, stores data in BSON format. Comparison between BSON and JSON BSON is faster than JSON when it comes to encoding and decoding.

Related: