Error reported using layui $is not defined

The following error occurs when calling a function using the layui template

reason: Layu needs to be pre loaded and defined$

<script type="text/javascript" rel="script">
    layui.use(['table', 'layer', 'form','element'], function(){
        var table = layui.table;
        var layer = layui.layer;
        var form = layui.form;
        var element = layui.element;
        var $ = layui.$;

</script>

Read More: