(Javascript error; Uncaught SyntaxError: missing ) after argument list)

Posted 2 years ago by SUPERNOVA

I keep getting this error (Javascript error; Uncaught SyntaxError: missing ) after argument list)

    <script type="text/javascript">
                        $('#districs').on('change' function(e){
                            console.(e);
                            var kec_id = e.target.value;

                            $.get('/ajax-vilObj?kec_id = ' + kec_id, function(data){
                                console.log(data);

                            });
                        });
                    </script>

myRoute :

Route::get('/ajax-vilObj', function(){
    $kec_id = Input::get('kec_id');
    $villages = Villages::where('kecamatan_id', '=', $kec_id)->get();
    return Response::json($villages);
});

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.