Re-using one of the many well designed jQuery UI widgets is good as it saves us development and maintenance time but the true power of the jQuery UI framework is the manner in which it enables us to devise completely new widgets that merge seamlessly with the rest of the framework and are indistinguishable in their use from the standard widgets. To illustrate what is possible, let's implement our unit converter again, but this time as a jQuery plugin:
Go to the directory containing the example code for Chapter 2.
Double-click the file
unitconverter2.py
, the CherryPy console will again open in a window.Enter
http://localhost:8080
in the address bar of your browser (or click refresh if it is still open on that address). You will now see a slightly restyled unit converter:
The interaction with this new unit converter is exactly the same as our previous one.