JSFiddle - React, Tailwind, and code Playground

by Ranganadh Paramkusam

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>JSON Sample</title>

    <script type="text/javascript">
    function clientDetailsJson(){
    
        var userData;
        clientDetailsJson.prototype.getUserData = function(){
            
            jQuery.ajax({
                type: 'GET',
                contentType: 'application/json;charset=utf-8',
                url: 'http://livetaxi.jelastic.servint.net/client/1',
                dataType: 'jsonp',
                crossDomain: true,
                jsonp: 'callback',
                jsonpCallback: 'livetaxi',
                success: function(d) {
                
                    this.userData = '';
                    this.userData += 'ID: ' + d.id + '<br />';
                    this.userData += 'Name: ' + d.name + ' - ';
                    this.userData += 'Email: ' + d.email + '<br />';
                    $('#results').html(this.userData);
                
                }
            
            });

        }
        
    }

    var obj = new clientDetailsJson();
    obj.getUserData();

    </script>
</head>
<body>
    <div id="results"></div>
</body>
</html>