Skip to content
  • There are no suggestions because the search field is empty.

Can I control present module?

You can control present projects via JavaScript by sending message events from your website to the iframe. This allows you to programmatically activate viewpoints, scenarios, or tours within the application.

Present I-frame JS messages


You can control present projects via JavaScript by sending message events from your website to the iframe. This allows you to programmatically activate viewpoints, scenarios, or tours within the application.

How It Works

The application listens for messages sent from the parent window. The message needs to be a JavaScript object with two specific properties:

  • type: A string that tells the application what you want it to do (e.g., 'active-viewpoint').
  • id: A number corresponding to the specific viewpoint, scenario, or tour you want to activate.

Allowed Iframe origins

  • In the EnergyPlanner dashboard, owners are able to add or remove certain urls.
  • These urls determine whether a website is allowed to communicate with the present i-frame.

The application checks the type and id in the message to determine which function to run along with the url that the message came from, it only runs the function if the url exists in the allowed Iframe origins list.