GlideAjax not work on service portal

jonnyyan
Kilo Contributor

HI Team,

I have a include script and have a function named 'InitForm' , this function is do some initial work on page loaded. and the function is work fine on 'OnLoad'.

currently ,i want to invoke the same function on service portal, but there is no response, please refer to below screenshot:

I just create a new widget, and input a button, when i debug the code, the responseXML is undefined

find_real_file.png

find_real_file.png

9 REPLIES 9

rishireddy
Mega Guru

Hi,



Does the script include of the 'Init' function has the 'Client' checkbox selected?


'Client' field should be selected ont the script include to accept the Glide ajax call.



PLEASE MARK THIS IS AS CORRECT OR HELPFUL IF THIS MAKES ANY IMPACT!!!



Regards,


Rishi Reddy


find_real_file.png


You can utilize the server script instead of making the glideajax. If glideajax is used, then make sure you don't override the initialize function if yes then you need to explicitly specify the parameters as request and responseXML.


Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

hmm.. never used glideajax calls in widgets, not even sure if they work. I see no need for it either since you get the server side script as well in the widget. Why not just load the data when the widget load in server script and pass in data to the client script directly?



//Göran