Home
Developers

Developers

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

Pageflakes API Reference

  • Flake System Object
  • Flake User Object
  • Pageflakes Functions
  • Array Extensions
  • String Extensions
  • ContentProxy
  • App
  • RSS
  • Tooltip Manager
  • Public, Shared, and Private Pages
  • Server-Side Scripting
Home » Documentation » API Reference

Flake User Object

The Flake User Object is defined by the flake developer.

load(fso)

This function must be defined. It is called by the framework when the flake is loaded. The load() function takes a single parameter instance which holds a reference to the Flake System Object. The instance parameter should be stored for future use.

onclose()

This optional function (if defined by the flake developer) is called when the user accepts the confirmation and the flake is ready to be closed. This function can be used to perform cleanup operations related to the flake instance.


      function com_pageflakes_devdocs_exampleflake()
      {
        this.load =
        function(instance) { ... }
        this.onclose =
        function() { ... cleanup stuff ... }
      }
      

dispose()

This function is created by the flake developer to dispose any data or references the flake is holding on to. Failing to dispose of resources used by your flake can cause memory leaks in Internet Explorer 6.
Such leaks make the browser slow, consume memory and can crash the browser.

The following actions must be performed in the dispose() function:

      Release references to UI elements (for example, references to <div> elements).
      Detach all event handlers from UI elements.
      Clear all arrays or large string variables which consume memory.
      Remove IFRAME elements, which can leak memory.

For example:


      dispose : function()
      {
        this.someDiv = null;
        PF.detachEvent(this.someDiv, 'click', this.clickHandler);
        this.someBigArray = null;
        PF.remove(‘myIFRAME’);
      }
      

refresh()

This function can created by the flake developer and is called by the framework when the user clicks on the Refresh button.

See also: enableRefresh() and disableRefresh() of the Flake System Object

‹ Storing Data with ProfilesupPageflakes Functions ›
»
  • Printer-friendly version