Tag Archives: javascript

Regular Expression for Removing HTML Tags

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

Posted in JavaScript | Tagged , , , , , , , , | 2 Comments

NodeJS, ExpressJS and MustacheJS Template Engine

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

Posted in JavaScript, mustache, node.js | Tagged , , , , , , , , , , , | 1 Comment

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

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

Posted in JavaScript, node.js | Tagged , , , , , , , , , | Leave a comment

How to Search a JavaScript Object Array

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

Posted in JavaScript | Tagged , , , , , , , , | 1 Comment

JavaScript Functions Best Practices Using Options

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

Posted in JavaScript | Tagged , , , , , , | Leave a comment

Get Length of JavaScript Object Array

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

Posted in JavaScript | Tagged , , , , , , , , | Leave a comment

How to add IE9 pinning Tasks and Jumplists to your site

Microsoft launched Internet Explorer 9 not too long ago. With that launch if you have Windows Vista or above, you have this neat functionality called “Pinning”. Basically a user can take your site, pin it to the Windows tool bar and it creates what they call a “jump list”.

Continue reading

Posted in HTML Goodies | Tagged , , , , , , , | Leave a comment

Ordinal numbers in javaScript

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

Posted in JavaScript | Tagged , , , | Leave a comment

JavaScript 5 Star Vote-Rating System

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

Posted in JavaScript | Tagged , , , , , , , | 1 Comment