JSFiddle - React, Tailwind, and code Playground

by sujay

HTML

<table border="0" cellpadding="2" cellspacing="0" class="formPanel" style="width:100%">
            <tbody><tr>
                <td>
                    <span style="vertical-align:middle;">
        <span>Date:
            <input id="datePicker" name="DatePicker" maxlength="10" value="20130128"/>
        </span>
            <input id="go-btn" style="width:80px;" type="button" value="Go"/>
                    </span>
                </td>
            </tr>
        </tbody></table>

JavaScript

$(function(){
    // Extracted the previously anonymous function to reduce memory used to store "compiled code"
    function processData(data) {
        //process data
    }
    // Extracted the previously anonymous function to reduce memory used to store "compiled code"
    function clickHandler() {
        var keys = ['googlechrome','firefox','opera', 'webkit', 'ie']; 
        for(var i = 0; i < keys.length; i++) {
            /* Previously a method call
             */        
            var date = $("#datePicker").val().replace(/-/g, ''),
                // Will be a local URL, That returns an avg of 3 MB and max 5MB.
                url  = "http://api.twitter.com/1/statuses/user_timeline.json?callback=?";
            
            url += '&screen_name=' + keys[i];
            url += "&count=250";
    
       
            $.getJSON(url, processData);
        } 
        
    }
    $("#go-btn").click(clickHandler);
});