Notifications

460 views

Symptoms


When opening a page (such as a catalog item) in Service Portal users are getting the "There is a Javascript error in your browser console" error thrown at the top of the page

If the browser console is inspected the following error can be observed as well:

Unhandled exception in GlideAjax.

Release


All releases that use Service Portal

Cause


While there could be different causes for the "There is a Javascript error in your browser console" error (as this is the generic error message that is displayed) this article documents the specific cause related to the "Unhandled exception in GlideAjax." error in the browser console.

In this case this is cause by any client scripts and/or UI policies that use getXMLAnswer() or getXML() functions without a callback function.

Resolution


Update any client scripts and/or UI policies that use getXMLAnswer() or getXML() functions to have callback functions.

The following is an example of using getXMLAnswer() without a callback function:

var ga = new GlideAjax('my_script_include');

ga.addParam('sysparm_name', 'test');

ga.getXMLAnswer();

 

And the following is an example of using getXMLAnswer() with a callback function:

var ga = new GlideAjax('my_script_include');

ga.addParam('sysparm_name', 'test');

ga.getXMLAnswer(myCallbackFunction);

 

function myCallbackFunction() {

return;

}

Additional Information


GlideAjax - Client

Article Information

Last Updated:2018-08-06 11:18:44
Published:2018-08-06