a tag's href and onclick execution order?

There are both href and onclick in the a tag. I want to judge whether to execute href through the return value of onclick. If the return of false is not executed, true is executed.


<a href="${entity.path}" style="color: #3FABE9;" onclick="return isLoad()">下载</a>

<script type="text/javascript">

    function isLoad(){

            var userId = '${user.id}';
            var flag = false;
            
            if(userId != null && userId != ''){
                flag = true;
            }
            if(!flag){
                $.jBox.info("Please Login first before downloading!", "System prompt");
                $('.jbox-body .jbox-icon').css('top','55px');
            }
            return flag;

        }

</script>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324724649&siteId=291194637