JSFiddle

  • jQuery - create method

    jQuery 1.9.1, HTML, CSS, JavaScript

    var $selector = $('.selector');
    
    // create the method - comment this out to run the test
    $.fn.methodName = function(){
        // 'this' refers to the ...
  • Convert timestamp

    No-Library (pure JS), HTML, CSS, JavaScript

    function convertTimestamp(timestamp) {
    	var d = new Date(timestamp * 1000),	// Convert to milliseconds
    		yyyy = d.getFullYear(),
    		mm = ('0' + (d.getMonth() + 1 ...
  • 1
  • 2