> For the complete documentation index, see [llms.txt](https://docs.airim.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airim.co/widget-javsscript-api/using-iframe-mode.md).

# Using Iframe mode

## Iframe mode

Iframe mode loads the widget in an iframe with source set to cdn.airim.co. This is for additional security as the iframe which loads is from another domain, it cannot access elements from the parent window.

```markup
<script type="text/javascript">
!function(t,n,i,c,r){t.AirimObj=r,t[r]=t[r]||function(){(t[r].q=t[r].q||[]).push(arguments)},e=n.createElement("script"),x=document.getElementsByTagName("script")[0],e.async=1,e.src="https://cdn.airim.co/widget.js",x.parentNode.insertBefore(e,x)}(window,document,0,0,"airim");
airim('mode','iframe') // important to be before init function
airim('init','<your_account_id>');   // dont forget to replace account id from settings page
</script>
```

To obtain your javascript code click [here](https://app.airim.co/home/settings/widget/jscode). Add the snippet `airim('mode','iframe')` before the init call
