load event vs self invoking function? : I would like to know if the following two cases has the exact same effect `performance and security wise` ? 
Which one is `better practice` ?

Using **load event**

        if (sSessionRole === "admin") {
            window.addEventListener("load", function () {
                getAjax("api_get_users.php", getUserData);
            });
        }

        function getUserData(ajUserDataFromServer) {

                //console.log( "USERS ARE EDITABLE" );
                showUsers(ajUserDataFromServer);
        } 

Using **self invoking function**

        if (sSessionRole === "admin") {
            (function () {
                getAjax("api_get_users.php", getUserData);
            })();
        }
        
        function getUserData(ajUserDataFromServer) {
            //console.log( "USERS ARE EDITABLE" );
            showUsers(ajUserDataFromServer);
        }