
ajax analysis api apple atom automator backpack browsers camping cheatsheets code console editors ergonomics gems google helipad hpricot internationalisation javascript lies mac optimisation patterns performance personal php plugins productivity programming prototype rails rapidrails rsi rss ruby server snippets standards sysadmin terminal testing textile textmate theory tips tools vim workshops writing xslt
Apparently, Opera 9 supports Server-Sent Events which you can read about in the WHATWG Web Applications 1.0 specification. Their demo application is a little chat program, which is a very obvious example of the technology.
There’s many times when I’ve wanted to add this to my applications: in Bugtagger I have to ask the service if a new message from a customer has been posted to a bug, every n seconds. It would be far more efficient for the serve to send a message using this technology.
And, since Opera’s so popular on embedded and mobile platforms, if this makes its way to mobile p…
This JavaScript class requires Prototype. It displays help on Textile next to elements with a particular class, and parses the help from a Hash that you can define in the constructor.
I’ve been using it to add help next to textareas that accept textile. All I have to do is create textareas with the class “show-textile-help”, and they get a little div full of useful information. The help text is hidden until the user clicks on the link:
AFTER A CLICK BY THE INTRIGUED USER:
Style it a little bit like this:
’ + element1 + ’’
})
textile_help += ’’
})
...
I’ve been writing some fairly complex JavaScript for a small project designed by my fiancĂ© (she makes demands for features like autosave without realising the amazing trickery required), and I started thinking about threading.
When you use XMLHttpRequest to fetch or send data, you create methods or functions to act as callbacks. At some point the callbacks are run, and data magically appears into your classes. That feels a lot like threading to me, the fact it’s asynchronous. I remember reading Thomas Fuchs saying something about JavaScript being single-threaded, a quick search found …
At my company, we’ve been interviewing people for a web developer position, with particular emphasis on programming. Something I’ve noticed is a lot of developers say: “I know JavaScript.” So a simple question I devised for testing this was, “how would you debug JavaScript?” You’d be surprised how many people don’t know the answer to this.
So, if you’re a php/perl/python/ruby/asp/etc programmer who “knows” JavaScript, here’s a few tools to help with debugging. These are Firefox extensions.
View Rendered Source Chart - I can't live without this, it allows you to view the html th...
Apple’s iDisk is part of the .Mac service. There’s always been a simple way to add files through the web interface (at http://www.mac.com), but Apple have recently improved it.
Once you click on an icon from your .Mac page, a window appears in which you can view your iDisk:
This allows you to:
Navigate folders in a similar way to Finder
Create and remove folders
Upload and delete files
Most of this makes use of Ajax and clever DOM magic, rather than the simple web interface they used before or Flash. It actually feels a little bit like a Flash interface, and if you look at t…
There’s a few little touches I like on sites I frequent: sensible tabindexes for forms, accesskeys and so on. Once I learn the accesskeys, I can fly around the main sections of a site. I apply these things to the sites I build, and the other day I realised adding accesskeys and supporting markup was no fun at all.
I wrote this JavaScript function to search for all your accesskeys and add some friendly markup. It even detects if the user is running Windows or Mac OS, to tell them to use ‘alt’ or ‘ctrl’:
function underline_accesskeys()
{
var links = document.getElementsByTagNam…
A few applications I’ve been developing recently have either had things from script.aculo.us applied for fun, to add effects our client would like, or they’ve been designed with Ajax and visual effects from the start.
A very beta application I’m working on is Multitap.net. Since it’s my project, and I don’t have clients to answer to, I’ve done whatever the hell I want with it. I had these things in mind when creating it:
I went to the Get Started Using Ajax workshop with Thomas Fuchs in London yesterday, and despite having used minimal Ajax and script.aculo.us effects before, learned quite a lot.
Thomas started off discussing the background of the technology, and wasn’t scared to dive into real examples, with PHP and Rails. He explained how the Ajax call works, and also discussed the pros and cons of using JavaScript libraries, such as Dojo and script.aculo.us, against using more lean server-oriented abstractions such as Sajax.
What was very interesting was his section on real world examples. The pr…
I often annoys me when people don’t make it clear what they’re referencing in an article. Sometimes people don’t give any references at all, and when they do they use links on words that shouldn’t be links (the click here syndrome).
So I wrote this Javascript to help out. It adds a section at the bottom of each of your Wordpress posts containing all the links you referred to in a post:
/* From Prototype /
document.getElementsByClassName = function(className) {
var children = document.getElementsByTagName(‘‘) || document.all;
var elements = new Array();
for (var i =...