yesJames.com
ahuh… sure… what ever you say…


Firefox compatible xPath functions in JavaScript

Posted in Ajax,JavaScript,programming by james on November 19th, 2008

There are a lot of quirks between different browsers, in particular though are the differences in the way each browser handles the DOM in JavaScript.

Internet Explorer, for the most part, implements MSXml 4.0 or higher. However that’s (obviously) a Microsoft technology, and the standard implementation doesn’t support XPath in the DOM.

In particular the selectNodes() and selectSingleNode() functions are of particular use when manipulating XML or the DOM. Using these functions you can parse an XPath expression and get a nodelist of elements in your DOM that match the expression.

(more…)

howto: Format numbers in JavaScript

Posted in JavaScript,programming,Software by james on November 19th, 2008

Formatting Numbers

Numeric formatting in JavaScript can be very tedious. From handling non-numeric characters, to multiple-currency symbols, to alternate negative display methods. The functions below should be valuable in assisting to format numbers and currencies of all types.

(more…)