JS Unexpected syntax error: unexpected string

JS error, finally found that the $(function () {}) part () is incomplete

$(function({
        $("#directionSelect").change(function(){
         
            $.ajax({
                url:"",
                success:function(data){
                    if(data.state=="fail"){
                        alert("The system is busy, please try again later!");
                    }else{
                     
                    }
                }
            });
        });
    });

After summarizing the previous errors, it is found that most of the errors are incomplete symbols, such as missing a bracket or a quotation mark

Similar Posts: