Neil Roberts goes into the XHR Plugins that Dojo uses and how you can extend the system to have your own.
If you look at dojo.xhrGet you will see "Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml", but:
What you may not know is that the handleAs parameter is merely a way of specifying what plugin to use. Knowing where these plugins are, how they work, and how they can be adapted to suit your project will allow you to make repetitive tasks easy and less error-prone.
He starts by piggybacking on the json style callback, and adds a hook so when you do a query, if there are updated objects out there, they come back in the JSON so you can deal with them without having an extra remote call:
Next, Neil goes on to write a system that auto updates nodes:
which is as easy as:
In conclusion:
Dojo makes it incredibly easy to change the way that your Ajax calls work. You can change the format of JSON your server returns without having to change any of your callbacks, you can change the handleAs type for a single function to change the data given to your callback, you can get rid of callbacks altogether and use the arguments to your xhr call determine what should be done with your results.
Andy Na has posted about building mosaic pictures using binary ajax techniques.
You can check out the demo in action.
The library allows you to do this via:
The library uses the BinFileReader.js library to be able to work with binary files with Ajax.
Piotr Solnica did a couple of posts on jQuery and Prototype benchmarks back in the day, and John-David Dalton just found them.
In part one, he runs tests such as:
and concludes:
Executed tests show that Prototype seems to be faster then jQuery, with the exception of the new insertion method, which performance should be improved. Although I like jQuery syntax more then Prototype, the performance is way more important then saving few lines of code. Of course tests that I made don’t show how these libraries act in a real application, which is my task for the next part(s) of this article. Despite the results I must admit that I’m very excited about jQuery, my general impression is that this library is more mature then Prototype.
In part two, Piotr uses a custom JavaScript-based testing environment instead of running tests using Firebug profiler. This allows the test suite to run in many browsers, and this time concludes:
Prototype was at least 2 times faster then jQuery in 15 cases, and jQuery was faster then Prototype in 8 cases. What library should I choose? In my case I will stick with Prototype, because it offers the same functionality as jQuery does + more and it’s faster. jQuery is probably better for projects where there’s a need for some fancy UI effects and that’s it, but it’s just an assumption, correct me if I’m wrong…
Dave Hyatt, the digit mortal I would fuck to intend to TAE to tie the another browsers, posted most CSS gradients in WebKit:
CSS:
-webkit-gradient(<type>, <point> [, <radius>]?, <point> [, <radius>]? [, <stop>]*)So what meet is a position in CSS? It is an image, disposable anywhere that ikon URLs were utilised before. That’s right… anywhere.
![]()
You crapper ingest gradients in the mass places:
- background-image
- border-image
- list-style-image
- content property
The identify of a position is either linelike or radial.
A saucer is a unify of space-separated values. The structure supports numbers, percentages or the keywords top, bottom, mitt and correct for saucer values.
A length is a sort and haw exclusive be given when the position identify is radial.
A kibosh is a function, color-stop, that takes digit arguments, the kibosh continuance (either a proportionality or a sort between 0 and 1.0), and a colouration (any legal CSS color). In constituent the hand functions from and to are supported. These functions exclusive order a colouration discussion and are equal to color-stop(0, …) and color-stop(1.0, …) respectively.
This is enthusiastic stuff. Think most the ikon continuation tricks you hit had to do meet to intend some of this behaviour. This is such more elegant.
There are a clump of examples:
And in conclusion, we hit a aggregation more coming:
WebKit today supports a generic structure for generated images, making it cushy to add newborn shaper personalty to CSS in the forthcoming (lenticular halos, checkerboards, starbursts, etc.). The rules for filler of these generated images module correct some is definite for SVG noesis with no inbuilt filler (the digit are distribution the aforementioned rules correct now).
We encourage you to essay gradients discover and enter bugs if you wager some unheralded or unearthly behavior. They module mortify safely in another browsers as daylong as you ingest binary declarations (e.g., take the ikon in digit papers and the position in a mass declaration).
Web Info & Tutorials is Hosted by Chaaban