Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Glide Ajax Client Script ServiceNow

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);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: js event preventdefault continue 
Javascript :: predicate function javascript 
Javascript :: javascript string contains substring 
Javascript :: string contains string javascript 
Javascript :: javascript test for empty object 
Javascript :: access variable outside for loop javascript 
Javascript :: discord.js remove reaction 
Javascript :: javascript Capitalise a String 
Javascript :: method to look for objects in arrays by id 
Javascript :: tailwind config 
Javascript :: react material ui classname 
Javascript :: local storage remove multiple items 
Javascript :: create file if not exists nodejs 
Javascript :: ionic status bar color 
Javascript :: set dropdown in jquery 
Javascript :: js new date short format 
Javascript :: what is the type of children prop 
Javascript :: javascript hide and show 
Javascript :: add active class to li onclick react 
Javascript :: regex repeat n times 
Javascript :: get number of days between two dates mongodb query 
Javascript :: javascript remove all children with class 
Javascript :: javascript object filter 
Javascript :: javascript iterate through a map 
Javascript :: split url javascript 
Javascript :: is object 
Javascript :: mongodb connection string node example localhost 
Javascript :: imdb-api 
Javascript :: jquery boilerplate 
Javascript :: javascript random 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =