Browsing articles in "Vanilla Javascript"

Javascript Round Number and Display Two Decimal Points

Quick tip of the Day: Javascript Rounding and always display Two Decimal Points Example:


Get URL Variables with Javascript

Today I needed a quick function to read URL variables in JavaScript. The code had to be library/framework independent as well as be cross browser compatible. Syntax: getUrlVars(variableName) Arguments: variableName – (string, optional) The variable name to search for. Returns: If variable name provided will return the value of the variable (string), if the variable name does not exist will return false (boolean) If variable name not provided will return an object containing all key/value […]


Javascript equivalent of PHP’s in_array() function

The in_array() function of PHP is super helpful when you need to quickly check a variable against an array of possible options. I am unsure why there is not a built in equivalent for javascript. That is one of many reasons why you may want to research mooTools or jQuery and start using it in your projects. From MooTools: Array method: contains Tests an array for the presence of an item. Syntax: Arguments: item – […]

Show/Hide Footer Actions

Status: Available for your project.