Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 990 Bytes

Readme.md

File metadata and controls

53 lines (36 loc) · 990 Bytes

load-iframe CI

Load an iframe by appending an iframe tag to the DOM.

Installation

$ npm install load-iframe
$ component install segmentio/load-iframe

Example

var load = require('load-iframe');

load('//www.google.com');

Loads Google in the iframe.

var load = require('load-iframe');

load({
  http  : 'http://www.google.com',
  https : 'https://ssl.google.com'
});

Loads in the right URL depending on the protocol.

API

loadIframe(src || options, callback)

Load the given iframe either by passing a src string, or an options object:

{
    src: '//example.com', // same as `src` string
    http: 'http://example.com', // `src` to load if the protocol is `http:`
    https: 'https://ssl.example.com' // `src` to load if the protocol is `https:`
}

License

MIT