Simon Willison’s Weblog

Subscribe
Atom feed for javascript

707 posts tagged “javascript”

2008

querySelector and querySelectorAll. WebKit now supports the W3C Selectors API. Expect the various JavaScript libraries to add this as an optimisation to achieve massive speedups (Prototype are already working on it).

# 8th February 2008, 11:21 am / prototype, javascript, safari, webkit, w3c, selectors, libraries, queryselector

Low Pro For jQuery? Dan Webb on why he prefers Prototype over jQuery: “The one big reason was that, while jQuery was super simple and concise when working on smaller projects, it offered no help in structuring larger applications”.

# 3rd February 2008, 10:16 pm / dan-webb, prototype, jquery, javascript, libraries, lowpro

Faster JavaScript Trim. Neat optimisation post—it turns out that while regular expressions are great for removing leading whitespace you can do a lot better at trailing whitespace by manually looping backwards from the end of the string.

# 3rd February 2008, 10:12 pm / whitespace, trim, javascript, optimisation, steven-levithan

Let me be again clear here that Comet isn’t a new single technique. Rather, it’s a combination of existing push technologies with further research into new methods that together provides a robust framework for pushing data to all clients on modern networks.

Michael Carter

# 3rd February 2008, 10:04 pm / michael-carter, comet, javascript

Blob Sallad—canvas tag and JavaScript physics simulation experiment. Björn Lindberg provides a detailed code walkthrough of his brilliant canvas demo, inspired by Loco Rocco.

# 26th January 2008, 12:25 pm / locorocco, javascript, canvas, opera, bjornlindberg, tutorial, physics

jQuery.ScrollTo (via) Neat jQuery plugin for animated scrolling of both windows and overflow elements.

# 21st January 2008, 9:53 pm / jquery, javascript, scrollto, scrolling, animation, plugins

Dangers of remote Javascript. Perl.com got hit by a JavaScript porn redirect when the domain of one of their advertisers expired and was bought by a porn company. Nat Torkington suggests keeping track of the expiration dates on any third party domains that are serving JavaScript on your site.

# 20th January 2008, 9:49 am / perldotcom, oreilly, nat-torkington, javascript, security, domains, xss

Automate firing of onload events. Paul Irish suggests setting up your site’s onload handlers in a single external JavaScript file then executing different handlers depending on the body element’s id attribute.

# 17th January 2008, 4:08 pm / javascript, paul-irish, onload

.first() and .last() methods for jQuery. I got fed up of expecting these to exist, so I wrote them as a couple of one-liner plugins.

# 16th January 2008, 9:41 pm / jquery, plugins, javascript

jQuery 1.2.2: 2nd Birthday Present. The API stays the same, but there are some healthy speed improvements, a new way of adding custom events and (most importantly) .ready() now waits for the CSS to be ready in addition to the DOM.

# 15th January 2008, 8:59 am / css, dom, javascript, jquery, libraries, documentready, ondomcontentloaded

Javascript CSS Selector Engine Timeline. It’s not every day you see a piece of code you wrote compared to a Ford Pinto :)

# 14th January 2008, 1:25 pm / fordpinto, funny, javascript, css

The Art & Science of JavaScript. The JavaScript book I contributed to is now shipping! My chapter describes how to build a Flickr / Google Maps mashup entirely using client-side code (via JSON-P).

# 12th January 2008, 7:05 pm / javascript, writing, books, flickr, google-maps, jsonp, json, sitepoint, theartandscienceofjavascript

Cross-Site XMLHttpRequest (via) “Firefox 3 implements the W3C Access Control working draft, which gives you the ability to do XMLHttpRequests to other web sites”—you can mark a document as available for cross-domain requests using either an Access-Control HTTP header or an XML processing instruction.

# 9th January 2008, 11:57 pm / xmlhttprequest, crossdomain, ajax, javascript, john-resig, accesscontrol, w3c, firefox, firefox3, mozilla, http, xml

$.comet (via) The first Comet (with Bayeux) plugin I’ve seen for jQuery—currently only handles long-polling over XMLHttpRequest, but still a promising start.

# 9th January 2008, 8:31 am / bayeux, comet, jquery, javascript, ajax, long-polling

Why we switched to Jetty. Zimbra (recently acquired by Yahoo!) are using Jetty for Comet. It sounds like they are using Bayeux as well.

# 8th January 2008, 5:12 am / comet, ajax, javascript, yahoo, zimbra, bayeux, jetty, java

20,000 Reasons Why Comet Scales. Greg Wilkins coaxes Jetty and Bayeux in to supporting 20,000 simultaneous users per server while maintaining sub-second latency, using Amazon EC2 to run the benchmark.

# 7th January 2008, 8:32 am / bayeux, jetty, java, comet, javascript, greg-wilkins, performance, ec2, benchmarks

IE7.js version 2.0 (beta). Dean Edwards has updated IE7, shifting enhancements that weren’t fixed by the real IE7 in to a new script called IE8. You can also now hotlink the library directly from Google’s servers, though I don’t know how intended Google Code’s subversion repository is for that purpose.

# 6th January 2008, 11:15 pm / google-code, goode, ie7, ie8, javascript, dean-edwards

EditArea. Impressive JavaScript source code editor, with syntax highlighting, brace matching, search and replace and more.

# 1st January 2008, 12:09 pm / javascript, editarea, syntaxhighlighting, bracematching, editor

JavaScript: It’s Just Not Validation! I like the explanation of JavaScript as offering input assistance rather than validation.

# 1st January 2008, 12:07 pm / javascript, validation, sitepoint, inputassistance

2007

Django and Comet. How to build a chat application using Django and the Orbited comet server. Orbited can be set up to proxy most requests through to a Django backend while handling any comet requests itself.

# 26th December 2007, 9:05 pm / comet, django, orbited, javascript, python

AppJet: Instant Web Programming. Another attempt at simple server-side JavaScript application hosting. Worth checking out for the impressive syntax highlighting code editor, which even matches braces.

# 15th December 2007, 3:37 pm / javascript, hosting, appjet, syntaxhighlighting, y-combinator

ExtInfoWindow 1.0: Ajax powered, CSS customization. Finally, a semi-official way of creating customised info windows for the Google Maps API. You lose the default shadow but gain the ability to style the entire info window using CSS.

# 15th December 2007, 12:22 pm / css, google-maps, google-maps-api, extinfowindow, javascript, ajax, google

Two-Faced Django. Excellent Django tutorial by Will Larson that shows how to build a polling application with an interface both on the Web and in Facebook. Also touches on unit testing and Ajax using jQuery.

# 14th December 2007, 2:44 pm / ajax, jquery, javascript, django, python, tutorial, facebook, pyfacebook

Unobtrusively Mapping Microformats with jQuery. My contribution to 24 ways: using Mapstraction to geocode hCards (extracted with jQuery) and plot them on a Google Map.

# 12th December 2007, 12:28 am / 24-ways, mapstraction, microformats, hcard, jquery, javascript, google-maps, geocoding

The Future of Comet: Part 1, Comet Today. Absolutely the best summary I’ve seen of all of the current Comet techniques in one place.

# 11th December 2007, 1:13 pm / comet, jacob-rus, long-polling, javascript, ajax, xmlhttprequest, iframes

Insert Dojo and YUI bookmarklets. Combine with Jash for interactive API experimentation on any web page.

# 9th December 2007, 12:38 pm / shell, jash, dojo, yui, javascript, bookmarklets, gareth-rushgrove

Jash: JavaScript Shell (via) An advanced JavaScript interactive shell bookmarklet that works in IE, Firefox, Opera and Safari.

# 9th December 2007, 12:36 pm / gareth-rushgrove, jash, javascript, ie, firefox, opera, safari, bookmarklet, shell

JavaScript Internationalisation, explained by reindeer. “Santa even spooked Comet recently by talking about him as if he were some pushy web server.”

# 8th December 2007, 2:04 pm / i18n, 24-ways, javascript, internationalisation, comet, matthew-somerville, santa

Comet works, and it’s easier than you think

Visit Comet works, and it's easier than you think

I gave a talk this morning at the Yahoo! Web Developer Summit on Comet, cometd and Bayeux.

[... 1,314 words]

YUI 2.4.0 released. Lots of great new features, but the one I’m most excited about is Selector: YUI finally has a CSS query engine.

# 5th December 2007, 3:32 pm / selector, yui, yahoo, javascript, css, libraries