user1371896
user1371896

Reputation: 2240

Iframe resizer not defined

I was trying to add our website in to one of our client website and used iframe resizer. Their website uses Brightspot CMS. So That gives iframe-resizer undefined error.

When I made some changes to iframe resizer js file, which is I removed

if (typeof define === 'function' && define.amd) {
        define([],factory);
    } else if (typeof module === 'object' && typeof module.exports === 'object') { //Node for browserfy
        module.exports = factory();
    } else {
        window.iFrameResize = window.iFrameResize || factory();
}

and only kept

window.iFrameResize = window.iFrameResize || factory();

With this change everything works fine. Any idea why this could be happening?

Upvotes: 0

Views: 509

Answers (1)

David Bradshaw
David Bradshaw

Reputation: 13097

If the website you adding this uses requireJS, then you must load this script with RequireJS.

Upvotes: 1

Related Questions