background preloader

JSON in JavaScript

JSON 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);

10 Impressive JavaScript Animation Frameworks Complex and slick JavaScript-based animation has been made easier with the emergence of frameworks and libraries that give developers the ability to create stunning and eye-grabbing animation and transition effects that make it easy these complex tasks. In this article, you will read about the top 10 JavaScript-based animation frameworks and libraries that will enable you to create engaging and captivating user experiences. 1. $fx $fx is a compact and lightweight JavaScript animation library which extends native JavaScript DOM methods with its own animation methods and functions. 2. jsAnim Created by web developer Kevin Dolan, jsAnim is a JavaScript animation framework for creating high-impact and slick animation sequences for web interfaces. 3. scripty2 scripty2 is a flexible and lightweight JavaScript animation framework for developing delicious visual effects. 5. Glimmer is a framework for easily creating interactive elements on your web pages. 6. 7. 8. 9. 10. Related content

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]

Xib2Js « Frog on Mobile Xib2Js for Titanium Mobile is Mac OSX application to convert the .xib file to the JavaScript codes. And TiMock is Titanium Mobile Application to communicate with xib2js and render the code to it’s screen. Build your UI with Xcode and just drag and drop the .xib file to the xib2js then the JavaScript code will be automatically generated. Then execute TiMock on your device or simulator and it will communicate with xib2js, so you can check how your UI looks like on actual device. The .xib parser is not good enough to generate the whole things perfectly so please do not expect too much but it will be much more easy to start creating Titanium application rather than writing the JavaScript code from scratch. Please download from the following and give your feedback via twitter about this application. [Application] xib2js2.0.dmg You need to build the TiMock by your self. [Source code] The source code of xib2js is available here . The source code of TiMock is available here . [Documents]

JSON d3.js 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 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

Force-Directed Graph This simple force-directed graph shows character co-occurence in . A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen . Data based on character coappearence in Victor Hugo’s , compiled by Donald Knuth . Source Code 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.