JSFiddle

  • HMAC Token handling. Mocked server and client example.

    Demonstration of HMAC SHA1 token validation and invalidation. In this example, tokens are being passed manually on the header. In a real implementation they would be passed via a cookie.

    //-------------------------
    //HELPER FUNCTIONS FOR DEMO
    //-------------------------
    var console = function(sel){
        var ele = !(sel instanceof jQuery) ? $(sel): sel;
        
        this.writeLine = function(text){
            var ...
  • XML Formatter

    Display XML as HTML.

    var XMLFormatter = (function(){
        
        return function(xml){
            var sb = []; 
            var data = $($.parseXML(xml))[0];   
            
            recurse(data, sb); 
            return sb.join(''); 
        };
        
        function ...
  • Simple MVC

    Custom multicast delegate, collection, and view. Built on jQuery, underscore, & mustache

    //_____________________________________________________________       
    //Application Logic
    //-------------------------------------------------------------
    //This is the minimal amount of code needed to create this basic
    //application using the library methods ...
  • jQuery - AJAX

    An overview of AJAX functions.

    !function(){
        
        //--------------------------------
        //GLOBAL AJAX HANDLERS
        //--------------------------------
        
        //Register a handler to be called when AJAX requests complete. 
        $('#log').ajaxComplete(function(event, XMLHttpRequest, ajaxOptions ...
  • jQuery - Traversing the DOM

    Some basic examples on DOM traversal

    !function(){
        
        //-------------------
        //HELPER FUNCTIONS
        //-------------------
        var i = 1; 
        var m_duration = 250; 
        var m_newProps = {'background-color':'#FF8C00'};
        var m_defProps = {'background-color':''};
            
        var addRow = function(){
            $('<tr><td>' + i ...</td></tr>
  • jQuery - Events Bind/Delegate/On

    Highlights the differences between bind and delegate

    !function(){
        
        //-------------------
        //HELPER FUNCTIONS
        //-------------------
        var i = 1; 
        
        var removeEvents = function(){
            //Cleanup after ourselves (remove the events we added)
            $('table > tbody > tr ...