Implement an in document UI
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 : Introduction - the for IE only original
ScriptX.Services cannot intercept the browser UI so we first create a simple UI within the document. This will work with both ScriptX.Add-on and ScriptX.Services.
We will need jQuery as it is a dependency for the ScriptX.Add-on to ScriptX.Services compatibility libraries so we will also use it to wire up the UI.
As can be seen, we have retained the old
viewInit() function. However as we use typical jQuery code for initialising event handlers for the UI buttons we have moved the call to viewInit() from the body tag to the jQuery "onload" event handler.
Browse to the sample
Open your browser (Internet Explorer) and go to the address https://scriptxprintsamples.meadroid.com/ThenToNow/ThenUI
The buttons can be used to print and/or preview the page as well as using the options from the browser Print menu.