JSFiddle - React, Tailwind, and code Playground

by tankchintan

HTML

<div id="output"></div>

JavaScript

function firstMethod() {
     
     var isConverted = false;
     

 
         $.get("/echo/json/", 
               {"conversion_state" : "SUCCESS"}, 
               function(data) {
             
                 //$("#output").append("in first method" + data);
                 isConverted = true; 
                   
                   if (isConverted && typeof updateMarkupOnSuccessfulConversion === 'function') {
                    updateMarkupOnSuccessfulConversion(videoID, currentStatusDIV);
                }
                 
             }, "json");

     
     return isConverted;
 }

function secondMethod() {
     
         
     $.get("/echo/html/",
           {"html" : "hi there"},
           function(data) {
 
           //console.log(data);
         
     });
     
 }

$(document).ready(function() {

    var isConversionSuccessful = firstMethod();
 
         //console.log("is conv success", isConversionSuccessful);
 
         if (isConversionSuccessful) {
 
              
             secondMethod();
 

         }

});