JavaScript

Regular Expression for Removing HTML Tags

Posted on
By Addam Driver

Here is a regex (regular expression) solution to remove HTML tags from content that doesn’t effect the content in javaScript or anything else for that matter… “/(<([^>]+)>)/ig” Continue reading

NodeJS, ExpressJS and MustacheJS Template Engine

Posted on
By Addam Driver

Here is a very scaled back way of using NodeJS, ExpressJS and Mustache JS to render full blown web pages using HTML templates. I seem to think this is a much easier solution than what I’ve seen so far on the web. Continue reading

Listen for Folder or File Changes Using “Node.js”

Posted on
By Addam Driver

Here is a quick tutorial on using fs.watchFile and fs.readFile in node.js. This will listen or “watch” for file changes on the server and then spit the contents of the file out to the console. However once you get a handle to the data you can do something more useful with it. Let’s check it out.

Continue reading

How to Search a JavaScript Object Array

Posted on
By Addam Driver

Searching a javaScript object can be a little tricky. While working on a project I found the need to search a dataset and do something useful with the findings. So my team and I came up with this nifty little script to allow an object to be searched by single values, multiple values and even wild cards. It’s fast and extremely easy to use. Continue reading

JavaScript Functions Best Practices Using Options

Posted on
By Addam Driver

Writing out javaScript functions is a no brainer. I was introduced to this thing called “options” a little while back from a friend of mine at Adobe. This isn’t “new” but it’s definitely REALLY USEFUL. This goes down as one of the “Best Practices” in my book. Continue reading

Get Length of JavaScript Object Array

Posted on
By Addam Driver

Unlike javaScript arrays, the “.length” property doesn’t exist in objects. Why? because it’s an object of data. Just a place to store stuff. So here’s a small and simple script you can run to return the length of an object so you can sift through it. Continue reading

Ordinal numbers in javaScript

Posted on
By Addam Driver

I came across a need to display numbers with “ordinals” (1st, 2nd, 3rd, 4th, etc.) in one of our pages at Foxsports.com.

I didn’t see any scripts out there that did the mathematics for this properly, so I created one that works pretty well. Check it out! Continue reading

JavaScript 5 Star Vote-Rating System

Posted on
By Addam Driver

I was asked to create a 5 star rating system for a few shows on NBC.com. So I created the following code. This is just the scaled down version but it works pretty well. You will need to add in extra code to send the results somewhere using Ajax or something like that. Try it out! Continue reading

CSS Methods

HTML Goodies

JavaScript

mustache

node.js

The HTML Writers Guild IWA