Yet more E4X irritations

I’m finding E4X to be one of those weird technologies that is alternately utterly wonderful and incredibly irritating. The ability to treat XML data as any other JavaScript data structure allows very fast app development and messing around, but every so often I find myself amazed at how awful the syntax is. Today’s irritation is about […]

E4X – A native XML datatype for JavaScript

I gave a talk on E4X. In a Just and Decent world, I wouldn’t have to write a blog entry on this, because there would be a nice front page to that listed all the recent things I’ve done, with the option to subscribe to RSS (or whatever) feeds of various subsets. But I’ve […]

JavaScript strings – a followup

Having played around with the JavaScript string type some more, I think I understand why it acts as it does. I’m a Perl monkey normally, so I’m not used to the concept of immutable strings, but JavaScript strings are immutable. Playing with the === operator (approximately, ‘is this the same object’) gives: js> "a" === "a"; […]

JavaScript string weirdness

Recently, I mentioned a peculiar difference between uneval and toSource. Specifically (using the SpiderMonkey JS console): js> uneval(""); "" js> "".toSource(); (new String("")) "" and new String("") are different types of objects. The first is the basic string type, and only really has a value. The second is a full Object, that happens to have a […]

uneval() does not produce JSON

More playing with JSON and Spidermonkey has revealed yet another incredibly annoying fact (I hate those guys). Spidermonkey provides a lovely uneval() function, that does the exact opposite of eval() – turns JS objects into strings. It works on almost everything, and make life very very nice. There’s also Object.toSource() which does something similar (but […]

further notes on JSON

Off I go, making random unsubstantiated claims about the danger of using JSON with non-ASCII characters. This called for a Test. So I wrote one. Visit my JavaScript unicode test page and see how your browser interprets external JavaScript files – I serve an ‘é’ using JavaScript to the page via 3 methods and 2 […]


In the bad old days of web 1.7ish, the cool thing to do for dynamic web applications was to generate HTML snippets on the server-side, pull them into your app using XMLHTTPRequest, and shove them bodily into a DIV on the page somewhere. “generating DOMs is hard” was the excuse, “the server already has a […]