JSFiddle - React, Tailwind, and code Playground

by hyperthalamus

HTML

<div id="dialog" title="Basic dialog">
    <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

JavaScript

if(!navigator.notification){
    navigator.notification = function(){}
    navigator.notification.alert = function(message, alertCallback, titles, buttonNames){
        console.log(this);
        alertCallback();
    }
    
}

function myFunction(){
    console.log(this);
    console.log("called my function");
    $("#dialog").dialog();
}

$(function(){
    navigator.notification.alert("problem", myFunction, ["OK"], ["okButton"]);
});