Simple serialization with XML strings in Javascript

Introduction Included in this post are some quick and simple functions for doing XML serialization in Javascript through strings. Reserved XML characters < > & ‘ ” are escaped from input and if any invalid input are found an exception will be thrown. List of XML utility functions: toXmlHeader() – Creates the XML header. toXmlElem(name: […]

Comparison against null and undefined in Javascript

Values in Javascript can come from Object – object reference String – immutable, 16-bit USC-2 Boolean – true, false Number – only 64-bit floating point, IEEE 754 (double) null – empty object reference undefined – unassigned variables and function arguments, missing object properties Boolean evaluation of values using == and != operators Values that are […]

Code documentation for Javascript and Actionscript 3

Prerequisites for Actionscript documentation Flex 2 SDK Prerequisites for Javascript documentation JSDoc For Windows users: ActivePerl HTML::Template – Perl module required by JSDoc For Windows users: Microsoft NMAKE – Build utility required by ActivePerl to install HTML::Template Actionscript 3 Code Documentation Example documentation: Extracting the documentation from the sourcecode: Javascript Code Documentation Example documentation: Extracting […]

Multiple Inheritance in Javascript

Notice Javascript does not support multiple inheritance, so the given method will break the instanceof operator! Javascript checks inheritance by traversing the linked list prototype.__proto__ for occurences of the requested prototype. This means that one prototype can only contain one reference to another prototype and in effect only inherit from one prototype. By discarding support […]