JSFiddle - React, Tailwind, and code Playground
JavaScript
(function(window, document){
var script_jquery = document.createElement('script'),
script_ui = document.createElement('script'),
link_ui = document.createElement('link'),
g_timeout = null,
g_interval = null,
v_interval = 10,
$;
script_jquery.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
script_jquery.onload = function(){ jQuery.noConflict(); document.head.appendChild( script_ui ); };
script_ui.src = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js';
script_ui.onload = loadComplete;
link_ui.href = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css';
link_ui.rel = 'stylesheet';
link_ui.type = 'text/css';
document.head.appendChild( script_jquery );
document.head.appendChild( link_ui );
function loadComplete(){
clear();
$ = jQuery;
var now = new Date(),
response = null,
timelag = null;
var jqXhr = $.ajax({
url: document.location.href,
success: function(){
response = new Date( jqXhr.getResponseHeader('Date') );
timelag = now-response;
commentQuestion( timelag );
}
});
}
function clear(){
if( g_timeout ) window.clearTimeout( g_timeout );
if( g_interval ) window.clearInterval( g_interval );
g_timeout = g_interval = null;
}
function commentQuestion( timelag ){
var $div = $('<div/>'),
$latency = $('<input type=text />').val(50),
$comment = $('<textarea/>').width('100%').text('우왕ㅋ 굳ㅋ'),
cmtidl = $('TEXTAREA#cmtidl'),
cmtEnabled = !!cmtidl.size() && $.isFunction( wtlsubmit ),
now = new Date();
var i_ymd =...