Welcome, guest Sign In

yml:include

Description

Includes content from the specified source. This tag also enables an application to refresh data in the Small view periodically.

Attributes

Name Type Required/Optional Description
params string required The relative path to the content, including any parameters required for the content. (This path is relative to the application containing the yml:include tag.)
replace string optional The ID of the DOM node to replace with the output specified by the params attribute. The entire node is replaced.
insert string optional The ID of a DOM node whose contents will be replaced with the output specified by the params attribute. Only the node's contents are replaced.
delay integer optional The number of milliseconds to wait before YAP gets the content specified by the params attribute. The content will not be loaded any sooner than the number of milliseconds specified. The default value is 0.

The delay attribute is not a strict contract. The YAP engine guarantees that the new content will not be loaded any sooner than the number of milliseconds specified by the delay attribute. However, it may take several seconds longer, depending on several factors. For example, if the value of delay is 5000, the new content may be inserted anywhere from 5 to 10 seconds after the content is loaded.

Examples

In the following example, the yml:include tag initially provides the string "some text here". After a wait of 5000 milliseconds, the content from myprog.php is fetched to replace the string "some text here".

In the next example, the content from myprog.php replaces the DOM node that has the div ID acct.

The following example shows how the yml:include tag can help engage your users by keeping the data in the Small view up to date. When a user first installs this application, the Small view shows the following: "I am loading right now. Click here to load latest prices." The yml:include tag in the Small view gets data by calling the prices.php program. When prices.php returns the data, the Small view shows a string such as: "Prices as of Wed, 01 Jul 2009 17:51:01 -0600 Reload get_the_prices_or_whatever_it_is_you_do". The yml:include tag in prices.php refreshes the data every 5 minutes (30000 milliseconds). The user can force a refresh by clicking the "Reload" link provided by the yml:a tag of prices.php.

For another examle, see Refreshing the Small View Dynamically.

Table of Contents

Copyright © 2009 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy

Help us continue to improve the Yahoo! Developer Network: Send Your Suggestions