Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

generates the code necessary to embed the object obj on a web page.

generates code for an external environment or language of type .

saves the generated code as files in the directory dir.

saves the generated code as a file archive in the file location loc.

Details and OptionsDetails and Options

  • In EmbedCode[obj], the object obj can be a CloudObject.
  • EmbedCode[obj] returns a string that can be inserted into the HTML of a web page to embed obj on the page.
  • In EmbedCode[obj,"dest"], the object obj can be a function with head APIFunction or FormFunction.
  • EmbedCode[obj,] also allows ExternalBundle objects representing a bundle of named resources.
  • Possible destinations for EmbedCode are given by the value of $EmbedCodeEnvironments.
  • Destinations relevant to the web include:
  • "WebPage"URL for complete web page
    "IFrame"embed code for an embeddable iframe
    "HTML"standalone HTML code to be embedded on a page
    {"dest",framework}use the specified framework for the code generated
  • Possible frameworks for interactive web content include:
  • "CloudCDF"CloudCDF with interactivity purely powered by the cloud
    "CloudCDFAllowingPlugin"CloudCDF with autodetection of local CDF plugin
    "CDFPlugin"cloud-hosted CDF for CDF plugin
  • General web frameworks include and . None uses no additional frameworks.
  • Destinations relevant to languages include "Java", "Python", "JavaScript", "C#", etc.
  • In typical cases of external programming languages, EmbedCode returns an containing an Association giving a variety of elements necessary for the embedding.
  • Typical options for EmbedCode include:
  • ExternalOptions<||>options specific to each environment or language
    ExternalFunctionNameAutomaticname to use for generated external function
    ExternalTypeSignatureAutomaticrules specifying mappings to external types
    ImageSizeAutomaticsize of embedded object in pixels
    MethodAutomaticembedding method to use
    PermissionsAutomaticpermissions to set for the cloud object
  • With the default setting Permissions->Automatic, EmbedCode[obj] will preserve the permissions for a cloud object obj and will use permissions given by $Permissions if a new cloud object is created.
  • With an explicit setting for Permissions, EmbedCode[obj] will effectively use SetOptions to change permissions of a cloud object obj.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Create embed code for embedding on the web:

Click for copyable input

Specify the size of embedding region:

Click for copyable input

Create code for calling an API from Java:

Click for copyable input
Introduced in 2014