JSFiddle - React, Tailwind, and code Playground

by Nick Hulea

JavaScript

$("#close").on("click", function (e) {
    e.preventDefault();
    //this part fires
    cvs.toBlob(function (blob) {
        saveAs(blob, (canvas_filename.value || canvas_filename.placeholder) + ".png");
        $.ajax({
            type: "POST",
            data: {
                imagetosave: imgtosave
            },
            url: "saveimage_mobi.php",

            beforeSend: function () {
                $("#preloader").css("display", "block");
            },
            success: function (data) {
                alert('close');
                $("#preloader").css("display", "none");
            }
        });
    }, "image/png");

    //this part does not 
    $outside.hide();
    alert('close');

    /*
    if I switch them the opposite happens but it never makes it to the end 
    */

});