Posts tagged "javascript"

Learning Object Oriented JavaScript Programing from ActionScript

I have been doing some JavaScript / Ajax development over the past couple of weeks, and have been trying to figure out the best way to structure my JavaScript and HTML code. One thing that really surprised me when doing research is how many JavaScript projects / examples do not try to encapsulate their code (aside from within script files) or use object oriented programing. Thinking back on this, and given the evolution of JavaScript from a web scripting glue to more of an application programing language, I can understand this, but it did surprise me none-the-less.

Continue reading…

Removing HTML Element children with JavaScript

Just a quick fyi, but if you are doing work in JavaScript and need to dynamically remove all of the childNodes from a DOM element, make sure to do it with a while loop, and not a for loop.

For example, this is bad:

Continue reading…

Parsing XML in JavaScript?

I have been doing some work with JavaScript / Ajax lately, and found myself needing to parse some XML (something I do quite often when building apps). However, I have not had much luck successfully parsing XML with JavaScript cross browser.

Continue reading…