---
title: "preload Function"
canonical: https://customerscanvas.com/docs/cc6/customerscanvas.iframeapi.preload.htm
archived: true
applies_to:
  - product: "Customer's Canvas On-Premises"
  - product: "Design Editor"
    versions: ["6.15.0", "6.x (may differ)"]
---

**You’re viewing outdated documentation.** [View the latest Customer’s Canvas On-Premises documentation](https://customerscanvas.com/docs/on-premises/).

# preload Function

**Applies to:** Customer's Canvas On-Premises; Design Editor 6.15.0, 6.x (may differ) · **Archived documentation**
 
### Callable
 
- preload( ) :  void

- Preloads resources of the web-to-print editor.
  
 - example
     - ```
    <!DOCTYPE html>
    
    <html lang="en">
    
    <head>
        <meta charset="utf-8" />
        <title>Customer's Canvas Quick Start Sample Page</title>
        <!-- The IFrame API script. IMPORTANT! Do not remove or change the ID. -->
        <script id="CcIframeApiScript" type="text/javascript" src="/cc/Resources/Generated/IframeApi.js">
        </script>
        <!-- Preloading resources of the editor. -->
        <script>CustomersCanvas.IframeApi.preload();</script>
    </head>
    
    <body>
        <!-- The iframe to display the editor in. -->
        <iframe id="editorFrame" width="100%" height="800px"></iframe>
    </body>
    
    <script>
        // Initializing a product with only one template - "BusinessCard.psd".
        var productDefinition = { surfaces: ["BusinessCard"] };
        // Providing the tokenId, which is required in the Secure Mode.
        var config = { tokenId: "95c16577-75fe-4145-87ff-c0ba49d1a554" };
        // Getting the iframe element to display the editor in.
        var iframe = document.getElementById("editorFrame");
        var editor = null;
        // Loading the editor.
        CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition, config)
            // If the editor has been successfully loaded.
            .then(function (e) {
                editor = e;
            })
            // If there was an error thrown when loading the editor.
            .catch(function (error) {
                console.error("The editor failed to load with an exception: ", error);
            });
    </script>
    
    </html>
    ```

#### Returns void
