YUI recommends YUI3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

This documentation is no longer maintained.

YUI Library Examples: ProfilerViewer Control: Simple Profiling

ProfilerViewer Control: Simple Profiling

In this simple example, the ProfilerViewer Control is used to profile an instance of the YUI Calendar Control. Interact with the calendar interface, then activate the ProfilerViewer to see the profile data. You can then continue to interact with the calendar, refreshing the data in the ProfilerViewer to update the profiling display.

A Simple Use Case: Profiling Calendar

One of the nice things about the YUI Profiler is that it makes it simple to profile any JavaScript function or object structure. ProfilerViewer's job is to make it just as easy to explore that data.

In this example, we create an instance of YUI's Calendar Control, tell Profiler to profile our Calendar instance, and then use ProfilerViewer to experience that data.

This example has the following dependencies:

We begin with empty div elements for Calendar and Profiler to use:

In JavaScript, we instantiate our Calendar and then pass the instance to Profiler for profiling:

Finally, we set up ProfilerViewer to consume the profiling information and make it visible in the interface:

The full JavaScript block for this example is as follows:

Copyright © 2013 Yahoo! Inc. All rights reserved.

Privacy Policy - Copyright Policy - Job Openings