# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.airim.co/widget-javsscript-api/using-iframe-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
