# HTML FAQs

#### How do I include the [JourneyApps iFrame Client](https://github.com/journeyapps/journey-iframe-client) in my HTML file?

Please see [this section](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/html-advanced-topics#include-the-journeyapps-iframe-client).

#### **Are there any limitations to what kind of websites I can reference as a** [**remote HTML source**](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/html/..#types-of-html-sources)**?**

Yes - sources may have restrictions that prevent them from loading in external iFrames. A common example is when cross origin is not supported, as in the case of:

```xml
<html src="http://www.google.com" />
```

#### What kind of data can I include in the [`post()`](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/html/..#post) method?

You'll be able to include values such as number or strings, or serialized objects.&#x20;

Posting a complex object (e.g. objects that include promises) or a function will likely throw an error. For such objects you might need to Base64 encode and/or apply `JSON.stringify()` before passing it in the `post()`. You will only be able to post function references, not functions themselves.

#### Can I use the developer console to troubleshooting the iFrame Client?

Yes, by selecting it from the list of available contexts:

<div align="center"><figure><img src="https://2865107717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9TCHLR67eLHBOjPvHhud%2Fuploads%2FFUAes9h5MxmO5UjOjITW%2FScreen%20Shot%202022-08-26%20at%208.27.42%20AM.png?alt=media&#x26;token=900b3a69-4e1b-4121-aa65-64e580da127f" alt=""><figcaption></figcaption></figure></div>

#### Why am I receiving sandboxing errors?&#x20;

If your HTML content is not loading and you are seeing references to sandboxing issues in the developer console, you are most likely trying to display [restricted content](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox).

The JourneyApps iFrame Client currently allows the following:

* `allow-same-origin`
* `allow-scripts`
* `allow-forms`
* `allow-modals`

Any other content will result in a sandboxing error.

Note that no additional restrictions are added/lifted on remote HTML sources by JourneyApps. The source may have its own sandboxing restrictions.

#### I am getting a "Callback for ... is already registered" error when returning to a view that has an HTML component on it. Why?

This happens when a view is already on the [viewStack](https://docs.journeyapps.com/reference/build/js-ts-apis/journey/viewstack) - the html component was registered the first time the view was entered and with the current implementation of the HTML and iFrame Client, you cannot re-register callback for these. You can solve this either by clearing the view from the viewStack before navigating to it, or by manually keeping track (e.g. a global variable in you SharedJS) whether the component was already registered, and not registering it again when returning to the view.

#### Why am I am getting a "No HTML component matching id: ... found" error upon entering my view?

You will receive this error when you attempt to `post()` to your iFrame Client before it has loaded successfully. For this you can add a [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event) or `window.addEventListener('load')` event to the iFrame, and post a message back to the app. An example of this is included [here](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/guide-html-and-journeyapps-iframe-client#basic-example).
