ariadnext-iframe-manager
v1.0.1
Published
an iframe library to manage our front applications
Downloads
945
Readme
ARIADNEXT-IFRAME-MANAGER
This library is used to help the integration of our applications in iframe.
Install
$ npm i ariadnext-iframe-manager
Usage
You need to import the ariadnext-iframe-manager. You can use import / require in your javascript source or a script tag.
Example:
var ariadnextIframeManager = require("ariadnext-iframe-manager");
ariadnextIframeManager.createIFrame("the_iframe_url", "#an-id", {
eventsHandler: (event) => console.log(event),
id: "axt-iframe"
});
After the import of the iframe manager, you can create an iframe with the function createIFrame.
This function needs three parameters, the link of your future iframe, the id where to put the future iframe and options.
In the options you need to send a callback for the events sent by the iframe in post message and you also need to send the id of the future iframe. This id can be used to refresh the iframe when you recall createIFrame with a new link.
The received event contain the type of the event and all the data sent by the iframe.
Event data example:
{
"type": "TYPE_MESSAGE_ENDED",
"publicToken": "a1c846bc-cd8c-46fb-9dc5-672ea71120d8-3349283103957800"
}
License
Copyright (c) 2010-2020 ARIADNEXT - All Rights Reserved. NOTICE: All information contained herein is, and remains the property of ARIADNEXT and its suppliers, if any. The intellectual and technical concepts contained herein are proprietary to ARIADNEXT and its suppliers and may be covered by U.E. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.