Using CORS Introduction APIs are the threads that let you stitch together a rich web experience. But this experience has a hard time translating to the browser, where the options for cross-domain requests are limited to techniques like JSON-P (which has limited use due to security concerns) or setting up a custom proxy (which can be a pain to set up and maintain). Cross-Origin Resource Sharing (CORS) is a W3C spec that allows cross-domain communication from the browser. By building on top of the XMLHttpRequest object, CORS allows developers to work with the same idioms as same-domain requests. The use-case for CORS is simple. As you can see from this example, CORS support requires coordination between both the server and client. Making a CORS Request This section shows how to make a cross-domain request in JavaScript. Creating the XMLHttpRequest object CORS is supported in the following browsers: Chrome, Firefox, Opera and Safari all use the XMLHttpRequest2 object. Event handlers withCredentials Resources
mustache(5) -- Logic-less templates. mustache(5) Mustache Manual mustache(5) mustache - Logic-less templates. A typical Mustache template: Hello {{name}} You have just won {{value}} dollars! {{#in_ca}} Well, {{taxed_value}} dollars, after taxes. {{/in_ca}} Given the following hash: Will produce the following: Hello Chris You have just won 10000 dollars! Mustache can be used for HTML, config files, source code - anything. We call it "logic-less" because there are no if statements, else clauses, or for loops. Tags are indicated by the double mustaches. Variables The most basic tag type is the variable. All variables are HTML escaped by default. You can also use & to unescape a variable: {{& name}}. By default a variable "miss" returns an empty string. Template: * {{name}} * {{age}} * {{company}} * {{{company}}} Hash: Output: Sections Sections render blocks of text one or more times, depending on the value of the key in the current context. A section begins with a pound and ends with a slash. False Values or Empty Lists Shown. Shown. Why?
Template A List of Foundational JavaScript Tools In our boot camps, students are introduced to several tools and libraries to expand the abilities of their code. Kalina, one of our current JavaScript students, compiled a list of these tools and wanted to share it with other Code Fellows. Ivan Storck, our JavaScript Boot Camp instructor, used Kalina's list to draft up this helpful mind map: General Scaffolding Tools (for starting projects) Yeoman - Yeoman is a robust and opinionated client-side stack, comprising tools and frameworks that can help developers quickly build beautiful web applications. Build Tools (automation) Grunt.js - The Grunt ecosystem is huge and it's growing every day. Package Management Tools Front End MVC Frameworks Backbone.js - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, and views with declarative event handling. Templates Testing Back End Servers Databases Architectural Style Assertion Libraries Update:
StringTemplate RESTful services with jQuery and Java using JAX-RS and Jersey NOTE: This is the Java version of this article and its companion app. A PHP version is available here. This is a more in depth version of my previous post on the same topic. The previous article only covered the HTTP GET method for building RESTful services. GET to retrieve and search dataPOST to add dataPUT to update dataDELETE to delete data The application used as an example for this article is a Wine Cellar app. You can run the application here. Implementing the API using JAX-RS JAX-RS makes it easy to implement this API in Java. Quick look at the JAX-RS annotations used in this class: @GET, @POST, @PUT, @DELETE: HTTP method the class method responds to. The jQuery client below sends data to the server using JSON (addWine() and updateWine() methods). The approach you use to actually retrieve the data is totally up to you. Testing the API using cURL If you want to test your API before using it in a client application, you can invoke your REST services straight from a browser address bar.
The jQuery UI CSS Framework – Part 1: Intro and How To Style a Button | Fbloggs Geekdom This is the first in a series of articles on the jQuery UI CSS Framework.. This is a powerful suite of CSS selectors that you can use to build web applications with a consistent UI. The main jQuery UI demo page shows you a list of UI widgets (which are still somewhat limited in scope compared to ExtJS, for example), but it doesn’t do a very good job on selling you on the benefits of designing other UI components, or components of those widgets, using the UI CSS framework. What is the jQuery UI CSS Framework? It is a set of CSS selectors that let you design your web pages to conform to the jQuery UI widgets standards. The jQuery UI CSS Framework provide semantic presentation classes to indicate the role of an element within a widget such as a header, content area, or clickable region. (from the jQuery UI Theming documentation page). Benefits of the jQuery UI CSS Framework Here are the top benefits I think the framework has to offer: It handles difficult design issues for you. Next Article
Javascript JavaScript JavaScript is classified as a prototype-based scripting language with dynamic typing and first-class functions. This mix of features makes it a multi-paradigm language, supporting object-oriented,[6] imperative, and functional[1][7] programming styles. JavaScript has been standardized in the ECMAScript language specification. History[edit] Beginnings at Netscape[edit] JavaScript was originally developed by Brendan Eich, while working for Netscape Communications Corporation. Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript[10] when it was deployed in the Netscape browser version 2.0B3.[11] The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. Server-side JavaScript[edit] Adoption by Microsoft[edit] Standardization[edit] Trademark[edit]
Mustache is a JavaScript template library that helps developers work with JSON objects instead of having their data source return HTML. When you make a network call to gather data from mobile devices, it's best to keep the payload, or the return data, as small as possible. JSON, or JavaScript Object Notation, is a string of characters that can be transformed into any array to pull in data. Most of the popular social networks, including Facebook, Twitter, and foursquare, and APIs, use JSON to return data.
Mustache has a lot of other features, including logic and loops that help you easily build out a list of data with a few lines of code. by indigetal Nov 29
Je test cette lib justement ! (avec node.js mais elle a l'air d'être utilisée aussi coté client.)
franchement avec un nom comme ça c'est normal qu'elle est du succés.... by simonw Nov 26