here a JS function addClassroom() is given, I have following Doubts :
in the line
since the function is not assigned to any object, how "this" will refer to the form object?
In the line :
$('#dialogClassroom div.divForForm form').submit(addClassroom);
.submit() require a function as argument, why it is not written like .submit(addClassroom()) instead?
I am not able to understand the sequence of events, why the function addClassroom() is called again within itself?
In the line
when the AJAX link is clicked , addClassroom() is executed and dialog is opened simultaneously or first addClassroom() will be executed and then dialog will be opened?
Thanks in advance