Simon Willison’s Weblog

Subscribe
Atom feed for dom

13 items tagged “dom”

2024

whenever you do this: el.innerHTML += HTML

you'd be better off with this: el.insertAdjacentHTML("beforeend", html)

reason being, the latter doesn't trash and re-create/re-stringify what was previously already there

Andreas Giammarchi

# 31st August 2024, 4:01 am / dom, javascript

2009

Unimpressed by NodeIterator. John Resig, one of the most talented API designers I’ve ever come across, posts some well earned criticism of the document.createNodeIterator DOM traversal API.

# 19th June 2009, 9:53 pm / javascript, api-design, dom, john-resig, nodeiterator

Crowbar. Headless Gecko/XULRunner which exposes a web service API for screen scraping using a real browser DOM—just pass it the URL of a page and the URL of a screen scraping JavaScript script (a bit like a Greasemonkey user script) and get back RDF/XML.

# 24th January 2009, 11:52 pm / rdf, xml, screenscraping, gecko, xulrunner, mozilla, dom, greasemonkey, webservice, crowbar

2008

Visual Event. External code loading bookmarklet that visualises the JavaScript events hooked up to the current page, and lets you view the source code of the event handling function for each one. Only works for events added by jQuery, YUI or MooTools since those libraries maintain a cache of event handlers that they add, to work around the standard DOM’s omission of handler introspection.

# 10th December 2008, 3:38 pm / events, javascript, allan-jardine, bookmarklet, dom, jquery, mootools, visualevent, yui

Implementing a syntax-higlighting JavaScript editor in JavaScript. Appropriately subtitled “a brutal odyssey to the dark side of the DOM tree”. Some seriously clever trickery going on here.

# 4th April 2008, 8:27 am / javascript, syntaxhighlighting, dom

<META HTTP-EQUIV="X-BALL-CHAIN">. Mozilla hacker Robert O’Callahan discusses the technical implications of freezing copies of older rendering engines, including the increased footprint and the terrifying prospect of documents in different rendering modes communicating through iframes and the DOM.

# 22nd January 2008, 6:55 pm / roberto-callahan, ie8, dom, mozilla, browsers, xuacompatible

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

2007

In the long term, I want to replace JavaScript and the DOM with a smarter, safer design. In the medium term, I want to use something like Google Gears to give us vats with which we can have safe mashups. But in the short term, I recommend that you be using Firefox with No Script. Until we get things right, it seems to be the best we can do.

Douglas Crockford

# 7th November 2007, 3:36 pm / javascript, noscript, firefox, google-gears, dom, security, mashups, douglas-crockford

Live Query jQuery plugin. Ingenious plugin that lets you register jQuery event bindings to be executed when a new element matching the provided selector is added to the DOM. Performance is kept snappy by only running the check after a jQuery DOM manipulation method has been executed (append, prepend, attr etc); it won’t notice elements added using regular DOM methods.

# 22nd August 2007, 10:01 pm / jquery, javascript, dom, selectors, brandon-aaron, plugins

Atom Models. Building Python classes that act as utility wrappers around data stored in an lxml DOM object.

# 7th August 2007, 4:02 pm / lxml, dom, xml, python, ian-bicking, atom

Mouseover DOM Inspector v2.0. Steve Chipman’s excellent debugging bookmarklet created back in 2005—includes useful keyboard shortcuts for quickly manipulating the DOM of the current page.

# 30th July 2007, 5:13 pm / dom, javascript, steve-chipman, modi, bookmarklet

Low Pro Behaviours 101. A neatly packaged method of enhancing an existing DOM element with pre-packaged behaviours.

# 17th July 2007, 10:09 am / behaviours, lowpro, dan-webb, javascript, prototype, dom

Live DOM Viewer (via) Neat tool from Hixie that provides an insight in to what browsers are actually thinking.

# 6th February 2007, 1:12 am / browsers, javascript, dom, ian-hickson