Solved: How to show Loading form while waiting for respons... - ServiceNow Community

How to show Loading form while waiting for response from script include?

inderpal
Kilo Expert

I have created a button on click of which a script include is called. I am using getXMLWait() for response to come from script include. It takes very much time to have the response from script include because of large processing in my script.
So for a while it looks like nothing is happening after clicking that button.
Is there any way i can show loading form or processing meanwhile on the screen?
i have used showLoadingDialog() method before calling my script include but it is not working..

My script is:

function XYZ() {

showLoadingDialog();

  var sub = new GlideAjax("XYZOrder");

  sub.addParam('sysparm_name', "Order");

  sub.getXMLWait();

  var yes = sub.getAnswer();

  hideLoadingDialog();

}

Please Help!!

1 ACCEPTED SOLUTION

I've run into this as well, some browsers don't load it for it processes to quickly; I've found a workaround with using setTimeout()



JavaScript Timing Events



Could try that and see if it assists? (long shot but may work).


View solution in original post

9 REPLIES 9

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Kalaiarasan Pus
Giga Sage

The code you have should work. Is the script evening getting called?


Yes, script is working perfectly fine...


inderpal
Kilo Expert

Forgot to add...
I am getting loading dialog in Mozilla browser only for Eureka version.
But it is not working for any other browser for any version.