Intro: The script uses the getJSON utility function. This fn does not allow you to pass the aync param. The current script does a synchronous fetch using the getJSON function by setting then restoring the global ajaxSettings using the ajaxSetup function.
Problem: If the timeout is undefined prior to the localize call, then, when the previous value is stored away, it is stored as undefined. When you attempt to restore the timeout, since its original value is undefined, it does not reset the timeout back to undefined from the 500ms value that is set by the script - the ajaxSetup function simply calls jQuery.extend which ignores undefined vals. The result is that after executing the localize function, all ajax requests longer than 500ms timeout.
Intro: The script uses the getJSON utility function. This fn does not allow you to pass the aync param. The current script does a synchronous fetch using the getJSON function by setting then restoring the global ajaxSettings using the ajaxSetup function.
Problem: If the timeout is undefined prior to the localize call, then, when the previous value is stored away, it is stored as undefined. When you attempt to restore the timeout, since its original value is undefined, it does not reset the timeout back to undefined from the 500ms value that is set by the script - the ajaxSetup function simply calls jQuery.extend which ignores undefined vals. The result is that after executing the localize function, all ajax requests longer than 500ms timeout.