In preparation for the next generation mobile browsers where JavaScript and the DOM will have a higher profile I have been doing some R&D about what is, and isn't, possible. Some general lessons learned thus far:
(1) Avoid using "document.write". Using this method breaks XHTML documents where a valid XML structure is strictly implemented. Use the DOM to add data to the document.
(2) Avoid using the "innerHTML" property. Microsoft introduced this method specifically for Internet Explorer and it was later adopted by Firefox and other browsers but it isn't part of any specification. Stick to specification methods like appendChild, createElement etc.
Update: Mobile JavaScript Test Suite
Some interesting links:
DOMScripting: The innerHTML dilemma.
Alternatives to innerHTML.
Sam Ruby: That's Not Write.

