Javascript Trim a String

How remove whitespace from both sides of a string (trim function): Pure Javascript var mystring = ”       dotmaui.com        “; mystring.trim(); For browsers that do not support the trim() method: String.prototype.trim = function() {…

JavaScript – Check if a variable is an integer

function isInt(value) { return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parseInt(value, 10)); } Tests: isInt(7) // true isInt(“7”) // true isInt(7e5) // true isInt(“7e7″) // true isInt(” 7 “) // true isInt(“”) // false isInt(“…

JS Minify 1.3.2 Released

To make JS Minify more and more complete, we started implementing some options. Version 1.3.2 provides: remove unreachable code drop unreferenced functions and variables join consecutive var statements preserve comments discard calls to console.* functions…

How to write a jQuery like library

jQuery is a great JavaScript Library, it helps to write less and simplifies JavaScript programming But often there is no need to include jQuery, because the necessary functions are few. It might be fun and useful…

Minify JavaScript API with PHP

Minimize javascript from an url with the .Maui APIs in PHP is quick, easy and free. You can choose between two compression levels: High, no readability, smallest size, or bass, higher readability. You can also…