📅  最后修改于: 2022-03-11 15:03:37.242000             🧑  作者: Mango
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var ga = new GlideAjax('serverCheck');
ga.addParam('sysparm_name', 'serverFunctionName'); //sysparm_name is reserved for the name of the script include function to call
ga.addParam('sysparm_group', g_form.getValue('assignment_group'));
ga.addParam('sysparm_other_variable', g_form.getValue('short_description')); //Any variable can be sent
ga.getXML(clientCallback); //Use getXML rather than getXMLWait. Input is your callback function
}
function clientCallback(response) {
var answer = response.responseXML.documentElement.getAttribute("answer"); //Get answer from server
//Do something with answer
g_form.setValue('short_description', answer);
}