Home
Developers

Developers

  • Documentation
    • Developer Guide
    • API Reference
    • Style Guide
    • How-To
    • Troubleshooting
  • Submit a Flake
  • Support

Pageflakes Developer Guide

  • Definitions
  • Getting Started
    • Prerequisites
    • Simple Flake
    • Framework Flake Processing
    • Flake Components
      • HTML/XHTML Markup
      • Flake User Object (FUO) & Flake System Objects (FSO)
      • Flake User Object Instantiation
      • Creating a Flake that Calls a Web Service
    • Adding a Settings Tab
Home » Documentation » Developer Guide » Getting Started » Flake Components

Flake User Object Instantiation

To instantiate the Flake User Object, another script is required:

<script id='_PAGEFLAKES_FUO' type="text/javascript">
      var _PAGEFLAKES_ = new com_pageflakes_hello('_PAGEFLAKES_');
</script>

This script is included once for every time the Flake exists in the page set, and it simply creates a new instance of the Flake User Object. For a given instance, here is what the actual executed code may look like:

<script id='abc12345FUO' type="text/javascript">
      var abc12345 = new com_pageflakes_hello('abc12345');
</script>

Note:

  • It is important to use the _PAGEFLAKES_FUO for the id tag of the <script> element so that the Pageflakes framework creates one such script block for each instance. If the _PAGEFLAKES_ token is not specified, the framework only creates the block once. Thus, not all instances of the flake Flake User Object are created.
  • The abc12345 variable that is created here is added to the global namespace in the Generated XHTML Document and is the reference used to access the flake’s Flake User Object.

Example

This is the code for the "Hello World" example flake described in this section.

  • Download
  • Add To Your Page
‹ Flake User Object (FUO) & Flake System Objects (FSO)upCreating a Flake that Calls a Web Service ›
»
  • Printer-friendly version