In this example, we bring a YUI component onto the page using the YUI Loader Utility. This example implements
This example loads in new window to demonstrate the simplest use case — a page with no other content, wherein the Loader is introducing YUI into a simple context.
The workflow happens in three steps:
YAHOO.util.YUILoaderinstance: We pass a configuration object to set up our instruction set for Loader, including things like what components to load, whether to load optional components, and what to do once the components are loaded (in this case, once the components are loaded we instantiate a Calendar Control on the page).
This code executes the following steps in order:
<link>element on the page.)
onSuccessfunction. This is the member of the configuration object in which we specfied our instantiation logic for Calendar.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.