Quantcast
Channel: Program & Design » JavaScript
Browsing all 5 articles
Browse latest View live

jQuery Select Text Range

Here’s a jQuery function I wrote which you can use to select a range of text in an input field. $.fn.selectRange = function(start, end) {     return this.each(function() {...

View Article



Human-readable file size in JavaScript

“size” is in bytes, the rest you should be able to figure out. function readableFileSize(size) {     var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];     var i = 0;     while(size...

View Article

jQuery Select Table Column or Row

Table rows are pretty easy to work as all the td elements are contained within one tr, but how would you grab all the tds in a single column? Why, by using these selectors of course! $.fn.row =...

View Article

Compile all Jade files to a single client-side JavaScript file

Jade is “a high performance template engine heavily influenced by Haml and implemented with JavaScript for node”. One of it’s nice features is that it lets you compile your Jade templates into...

View Article

Selenium, PhantomJS, Node, Screenshots and Sizzle

Without going into too much detail, I just wanted to post a snippet of how to get all these technologies playing nicely together: var webdriver = require('selenium-webdriver'); var fs = require('fs');...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images