Why does the ready event not fire if the function is async

28 Views Asked by At
// Does not fire
$(document).ready(async function()
{
    alert("im ready");
});

// Does fire
$(document).ready(function()
{
    alert("im ready");
});

// Annoying fix
$(document).ready(function()
{
    (async() =>
    {
        alert("im ready");
    })();
});

Other events such as clicks, and input do support the async function. The only one that doesn't is the ready event. Any ideas why?

0

There are 0 best solutions below