This walk-through illustrates taking a classic document that has a controlled print experience and works only in Internet Explorer and making it work with ScriptX.Services in any browser on any platform using the minimum amount of development effort and making as few changes as possible (though more changes might be desirable).
Previously : Stage 3 - Summary and review
Some of the defects in the code that we will address are improvements that could/should have been made to the “old” code too but from here on we will work to improve working with ScriptX.Services knowing that many of these changes will benefit working with ScriptX.Add-on too.
Helping with debugging
It is useful to have some information on the processes being performed. The ScriptX.Services Client Library generates a lot of log lines to the console but these are suppressed by default and need to be enabled.
Errors that occur are reported in the console and also with a simple alert box. The functions that report the errors can be overwritten to use the application error UI.
The functions to be overwritten are:
Called when an error occurs with a single string argument containing the text of the error.
Called when a feature is used that is not yet implemented with a single string argument containing the descriptioon of the feature.
Open your browser (any browser) and go to the address https://scriptxprintsamples.meadroid.com/ThenToNow/now-stage4
Touch “Preview” and note that the error message is as coded above.