…the same data types that jQuery supports: text, HTML , JSON , JSONP , Script, and XML .
Mocking a request looks a lot like the ajax API :
$ . mockjax ({ url : '/restful/fortune' , responseTime : 750 , responseText : { status : 'success' } });
Mockjax modifies jQuery using $.extend({ ajax: function() { // ... } }); — by passing one argument to $.extend the jQuery object itself is modified. The original ajax module is kept around internally …
…able to parse a JSON string, but if your browser already had built in support for JSON parsing, it didn't require you to load anything extra!
HTML5
JavaScript-powered asynchronous loading isn't the end of the story. In HTML5, the script element has been updated to support async and defer attributes. This is already available in recent WebKit-based browsers and Firefox 3.6.
These attributes effectively let us do what LABjs offers:
If async is present, …
…by Wayne Pan and this demo by Joe Lambert explains but this also seems quite verbose.
I'd love to have a CSSAnimations collection for example where you could store different animations in JSON or as a string and have their name as the key. Right now, creating a new rule dynamically and adding it either to the document or append it to the ruleset seems to be the only cross-browser way. Thoughts?
You know what the DOM is, and if you don't it's easy enough to find out . What isn't so easily discovered is the answer to this: how should your code communicate with the DOM API? Should it be treated as just another API? Is it no more deserving than, for example, a JSON web service or the web storage API?
What I've been seeing a lot of is the DOM becoming incredibly intertwined with the logic, i.e. the program becomes indifferentiable to the DOM. It all ends up being the same:
Libraries and Frameworks
Responsive-Menu is a jQuery plugin to display menus as a select dropdown on mobile devices
jQuery Boilerplate is a boilerplate for creating jQuery plugins.
wru is a unit test framework for node.js and Rhino
box2dweb is a port of Box2DFlash 2.1a to JavaScript.
JSONDB is a tiny script to pack and unpack (flatten and unflatten) JSON for transmission over the fire
Why is JSON so popular? Developers want out of the syntax business
Multiple object extend pattern in JavaScript
r/bookmarklets is a bookmarklets enthusiast community on reddit
Node.js tidbits
Synchronizing HTML5 Slides with Node.js
Couchtato - A CouchDB Document Utility Tool Written In Node.js
Porting Node to Windows With Microsoft's Help
Creating …
…This allows the normal eSpeak datafiles to be used (either through an xhr, or by converting them to JSON and bundling them with the script file). The result of running the compiled eSpeak code is that it ‘writes' a . wav file with the generated audio to the emulated filesystem. speak.js then takes that data, encodes it using base64, and creates a data URL. That URL is then loaded in an HTML5 audio element, letting the browser handle playback. (Note that while that is a very simple way …
I have already described JSONH and now I also have the proof that it's as safe as native JSON is but on average 2X faster than native JSON operations with both small (10 objects), medium (100 objects), and massive (5000 objects and not a real world case, just a stress test to see how much JSONH scales) homogenous collections.
Wherever it's not faster it's just " as fast " but the best part is that it seems to be always faster on slower machines ( mobile ).
…expecting is that actually different projects and developers adopted this technique to shrink down JSON size.
Basic Advantage Of JSON.hpack Gzip and deflate work really good with repeated chunks of strings and this is why homogeneous collections have really good compression ratio there.
However, gzip and deflate compression does not come for free!
If we compress everything on server side we can easily test the CPU overload compared with uncompressed data.
Via JSON.hpack we …
…Function.prototype.bind , String.prototype.trim , JSON.* , etc. These are the things that are shimmed most often. And the question is — is it OK to extend native, built-in objects with these standardized methods?
Well, let's quickly go over problems with host objects extension:
Host vs. Native
"Lack of specification" doesn't apply here, as long as methods that are being shimmed are part of ES5 (or ES3) . ES5 is a standard. There's …