JSFiddle - React, Tailwind, and code Playground

by nerdycap007

JavaScript

var url = 'https://twitter.com/FanaHOVA/status/1242664683527692289'
if (url) {
  $.ajax({
    url: "https://api.twitter.com/1/statuses/oembed.json?url=" + url,
    dataType: "jsonp",
    async: true,
    success: function(data) {
      console.log(data)
    }
  });
} 
/* 
function httpGetAsync(theUrl, callback) {
  if (theUrl) {
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.onreadystatechange = function() {
      if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
        callback(xmlHttp.responseText);
    }
    let finalURL = "https://api.twitter.com/1/statuses/oembed.json?url=" + theUrl
    xmlHttp.open("GET", finalURL, true); // true for asynchronous 
    xmlHttp.send(null);
  }
}

httpGetAsync('https://twitter.com/FanaHOVA/status/1242664683527692289', (result) => {
  console.log(result);
})
 */