JSFiddle - React, Tailwind, and code Playground
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('/', {}, $.proxy(this.display, this));
}
this.display = function (data) {
console.log(this);
}
}
$(function () {
var st = new serverTime();
st.get();
});