Blog

JavaScript – Removing Text Nodes

Recently I have been involved in modifying websites with a module that allows for CSS and JS insertion. A bothersome issue that has arisen a few times is the fact that this tool doesn’t currently provide a way to remove the text nodes of just the targeted element. Fortunately, I Read more…

By Chris West, ago
Blog

JavaScript – Date Difference Function

A few months ago I wrote a blog post about extensions to the Date.prototype. That post provided ways to add date parts and subtract date parts. Today’s post shows you how to use a generic Date.prototype.diff() function to find the difference between two dates and optionally return a string specifying Read more…

By Chris West, ago
Blog

JavaScript – Degree & Radian Conversion

Two very simple operations that you may have to deal with if writing a JavaScript that deals with trigonometry are Math.degrees() and Math.radians(). These function can be easily defined as follows: The name of these functions indicates the end result. Using the above definitions, you could run code such as Read more…

By Chris West, ago