I have the following code:
var formSubmitHandler = function (link, form) {
//e.preventDefault();
var $form = form;
var val = $form.valid();
$ and jQuery are basically the jQuery instance.
It's good to understand that $( < place something here >) is a jQuery function call and $your_variable_name is just a variable with a dollar.
Some people use $ in their own variables to indicate that it is a jQuery object. With this naming convention, your source code would like this.
var formSubmitHandler = function (link, form) {
var $form = $(form);
var val = $form.valid();
var action = $form.data('action');
var entity = $form.data('entity');