Tag: JavaScript
-
JSON vs XML
Many of you have probably wondered which format is better or which should be used. You might have even participated in a full blown nerd rage war on the matter. Both formats are good when you want to describe a hierarchical structure. Differences XML is a markup language and is good for documents description or…
-
Applying CSS Styles Before Printing with AngularJS
In a world full of fancy shining jQuery plugins one can’t simply print. Often you’ll be using a grid JavaScript plugin or another heavy visualization component. One of the pitfalls you might experience with those components is that they don’t look nice when you try to print them. Sometimes this can’t be solved by with…
-
JavaScript .Net like String formatting function
Just a simple extend to the JavaScript String prototype which makes things much more readable 🙂 String.prototype.beginsWith = function(str) {return (this.match(“^”+str)==str)} String.prototype.endsWith = function(str) {return (this.match(str+”$”)==str)} String.prototype.format = function() { var s = this, i = arguments.length; while (i–) { s = s.replace(new RegExp(‘\{‘ + i + ‘\}’, ‘gm’), arguments[i]); } return s; }; Example:…