Script Function - fatsecret.setContainer(container)

Description

Used to nominate an element in the browser's document object model (DOM) as the container in which the application will be placed. See How It Works for more information.

Parameters

Required

Name Type Description
container String The value of the "id" attribute of the named element to use as the container.

Example

Setting the container to a named element "my_div":
<script src="https://platform.fatsecret.com/js?key=XXXXX"></script>

<div id="my_div" class="fatsecret_container"></div>

<script>
fatsecret.setContainer("my_div");
fatsecret.setCanvas("home");
</script>
FatSecret Sites
For Developers

For Professionals

For Everyone

FatSecret Platform API

Support
API

About FatSecret

© 2021 FatSecret. All rights reserved.