JSFiddle - React, Tailwind, and code Playground

by komaruloh

HTML

<!doctype html>
<html>
    <body></body>
</html>

JavaScript

function serverTime() {
    this.get = function () {
        // time.php should return "date('Y-m-d H:i:s')" 
        // of php date function
        $.post('time.php', {}, $.proxy(this.display, this), 'json');
    }
    this.display = function (data) {
        eval('debugger;');
        alert(data.serverTime);
    }
}

$(function () {
    var st = new serverTime();
    st.get();
});