background preloader

JSON

JSON

JSON, un format pour échange de données avec JavaScript JSON ( jison ou jayson, jason en anglais) est reconnu par JavaScript, après que l'ECMA ait définit la fonction eval qui parse le format, dans le standard ECMAScript, en 1999. Il a été popularisé par le développement d'Ajax. Le terme JSON revient souvent lorsque l'on parle d'Ajax. JSON vs. Les avantages de JSON: La vitesse de traitement. Les avantages de XML: XML est extensible quand au langage, on peut créer des formats comme RSS, SVG. Noter que XML aussi bien que JSON ne conviennent pas pour stocker directement des données binaires de taille importante. La syntaxe de JSON Les éléments de JSON sont: Un objet: contient d'autres objets ou des variables. L'objet Il contient un membre ou une liste de membres, chaque membre étant de la forme: "nom" : "valeur" La syntaxe de l'objet est: { membre, membre, .... } Le tableau Contient une ou plusieurs valeurs séparées par des virgules. [ valeur, valeur, ....] Les valeurs Et il n'y a besoin de rien de plus à savoir pour créer un fichier JSON! <? Coté client

Sproutcore and App Dev In General I’ve been intentionally learning how to develop using Sproutcore for about a month now, so I’ve been more aware of the buzz about it, and I have to say that most things I read are missing the point about the value promise of Sproutcore. The impetus behind my learning is that it is an application development framework for the HTML5/JavaScript platform, versus the Flash Platform that I’m used to developing for. The key here is that it is an application development framework. It is not another DOM access library, widget set, or MVC, and it shouldn’t even be compared to them. It’s not a “Flash-killer“. Flash is just a display technology. I realize that Adobe’s building in support for FlexUnit4 in Flash Builder 4 / Flex 4 SDK which is wonderful. If you look at what Microsoft is doing with Silverlight, they are positioning themselves to own that stack, and not only that, but they have the advantage of not being the first in that they can fix all the things that Adobe has done wrong.

JSON with Java This chapter covers how to encode and decode JSON objects using Java programming language. Let's start with preparing the environment to start our programming with Java for JSON. Environment Before you start with encoding and decoding JSON using Java, you need to install any of the JSON modules available. For this tutorial we have downloaded and installed JSON.simple and have added the location of json-simple-1.1.1.jar file to the environment variable CLASSPATH. Mapping between JSON and Java entities JSON.simple maps entities from the left side to the right side while decoding or parsing, and maps entities from the right to the left while encoding. On decoding, the default concrete class of java.util.List is org.json.simple.JSONArray and the default concrete class of java.util.Map is org.json.simple.JSONObject. Encoding JSON in Java Following is a simple example to encode a JSON object using Java JSONObject which is a subclass of java.util.HashMap. Decoding JSON in Java

/latest.json · Open Exchange Rates Definition Parameters app_id: stringRequired Your unique App ID (required) base: stringOptional Change base currency (3-letter code, default: USD) symbols: Limit results to specific currencies (comma-separated list of 3-letter codes) Examples Result Format Documentation The base property provides the 3-letter currency code to which all the delivered exchange rates are relative. The rates property is an object (hash/dictionary/associative array) containing all the conversion or exchange rates for all of the available (or requested) currencies, labeled by their international-standard 3-letter currency codes. The timestamp property indicates the time (UNIX) that the rates were published. Additional Parameters Changing the base currency and requesting specific symbols are currently available for clients on the Developer, Enterprise and Unlimited plans. More code samples are on their way!

Flexigrid jQuery java - How to convert a String to JsonObject using gson library JavaScript/DOM/Event/Übersicht – SELFHTML-Wiki Events (Ereignisse) und Event-Handler (Ereignisbehandler) sind ein wichtiges Bindeglied zwischen HTML und JavaScript. Event-Handler werden entweder in Form von Attributen in HTML-Tags notiert (siehe auch HTML/Eventhandler), besser aber mittels der Methode addEventListener hinzugefügt. [Bearbeiten] alphabetisches Verzeichnis ratechange (Änderung der Abspielgeschwindigkeit) reset (beim Zurücksetzen des Formulars) resize (beim Verändern der Fenstergröße) scroll (Dokumentansicht wird entlang der x/y-Achsen verschoben) search (wenn etwas in einem Suchformular gesucht wird) seeked (wenn Nutzer andere Stelle ausgesucht hat) seeking (wenn Nutzer zu anderer Stelle geht) select (beim Selektieren von Text) stalled (Laden des Mediums nicht erfolgt) storage (Speicher-Ereignis) submit (beim Absenden des Formulars) suspend (Ende des Ladens) unload (beim Verlassen der Datei) volumechange (Lautstärkeänderung) zoom (Dokument-Zoom-Stufe oder aktueller Maßstab wird geändert)

Related: