Day 12: DDIS - Synchronous AJAX call getReference in client scripts
Scan Check Type: Script Only Check
Code that uses synchronous AJAX feels very slow. It is detrimental to the user experience.
For data that can change during the user experience, replace g_form.getReference with GlideAjax, a callback function, and a custom function in a Script Include that returns only the needed information. For data that remains the same after the form loads and can be determined before the form loads, replace g_form.getReference with a Display Business Rule and g_scratchpad.
This scan was developed using a script only check with conditions to identify custom client scripts that use the getReference function. There is a very similar script that is in the Example Instance Checks GitLab project, “Using Synchronous AJAX calls in client script”. However that check only gets for getXMLWait in types of onLoad or onChange, which doesn’t cover the full range of functions like getReference. This check is also found in the QualityClouds product.
Download and import the XML to check it out in your instance! At the end of the month I will be bundling all the checks together.
Day 12 scan_script_only_check_f9434b272f8b59107caa93acf699b655.xml