JSFiddle - React, Tailwind, and code Playground

by timothy_shee

HTML

<html>
<head>

</head>
<body>
  
</body>
</html>

JavaScript

function getJSONP(url, success) {

    var ud = '_' + +new Date,
        script = document.createElement('script'),
        head = document.getElementsByTagName('head')[0] 
               || document.documentElement;

    window[ud] = function(data) {
        head.removeChild(script);
        success && success(data);
    };

    script.src = url.replace('callback=?', 'callback=' + ud);
    head.appendChild(script);

}

getJSONP('https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of%20Contemporary%20Art%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&key=AIzaSyAX_qNASWYPxS1Q1c-S__3pT8OJIg595bY', function(data){
    console.log(data);
});