Tag Archives: javascript functions

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