Implementation of js function that use the generic AJAX call