JSFiddle - React, Tailwind, and code Playground

by Bhavin Surela

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
    <input id="oo_button" type="button" value="Submit" class="button" onclick="_om_doPosts();" />

JavaScript

_om_doPosts = function() {
 document.getElementById("oo_button").disabled = true;

// submit optout requests
// when both complete, the always handler runs and will navigate to the success(status) page
//
$.when( $.post( "https://optout.yieldoptimizer.com/optout/opt" ), $.post( "https://optout.adaraanalytics.com/optout/opt" ) )
  .always(function( a, b ) {
   document.getElementById("oo_button").disabled = false;
   // this can probably be relative path 
   window.location.href = "./privacy-promise/opt-out-success";
  });
}