Script Function - fatsecret.setCanvasUrl(canvas, url)
In some cases, it may be desirable to partition your application so that one or more of the application canvases are loaded into distinct containers
embedded at distinct URLs.
Common scenarios for splitting the API across multiple URLs include:
- Having a web page that provides a single entry point to the application showing the home
canvas content and a dedicated web page for all subsequent canvas content that may use a different theme.
- Providing a dedicated web page for authenticating users that redirects to your sites registration page as a hook to enable deep integration with your own profile database.
- Manually loading sections of canvas content, or providing one or more web pages that make REST API calls to output a response to users.
fatsecret.setCanvasUrl is a directive to the application to load the content of one or more nominated canvases
at an alternate URL. If a user takes an action that requires
that canvas content
associated with an alternate URL to load, the state on the current canvas
, together with information about the action to be taken is stored and the
user is redirected to the alternate URL. Use fatsecret.setDefaultCanvasUrl
to set an alternative URL for all canvases
||The name of the canvas to load.
||The alternate URL for this canvas.
Set an alternate URL for the food.get canvas
(see Manually Loading Content