Discussion:
[Caja] load caja from iframes and load the caja lib ones in window.parent.caja
o x
2017-05-02 07:53:02 UTC
Permalink
hello
i have a few iFrames loading the Caja lib..
so i have tried to load the lib from the parent page, but something get
wrong..

console.log(window.parent.caja);

window.parent.caja.initialize({
cajaServer: 'https://caja.appspot.com/',
debug: true
});

and Parent

$.getScript('//caja.appspot.com/caja.js', function () {
loadFunc();
});


i got this on the consul:
Uncaught TypeError: Cannot set property 'plugin_dispatchEvent___' of
undefined
at makeDomicileAndEmitter (ses-single-frame.js?debug=1:29542)
at Object.makeES5Frame (ses-single-frame.js?debug=1:29456)
at caja.js?_=1493711102536:264
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-caja-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Kevin Reid' via Google Caja Discuss
2017-05-02 16:49:40 UTC
Permalink
Post by o x
hello
i have a few iFrames loading the Caja lib..
so i have tried to load the lib from the parent page, but something get
wrong..
[...]
Post by o x
Uncaught TypeError: Cannot set property 'plugin_dispatchEvent___' of
undefined
at makeDomicileAndEmitter (ses-single-frame.js?debug=1:29542)
at Object.makeES5Frame (ses-single-frame.js?debug=1:29456)
at caja.js?_=1493711102536:264
In each of your frames, do

caja.initFeralFrame(window);

before calling caja.load, and this should work.
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-caja-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
o x
2017-05-03 03:54:49 UTC
Permalink
thank you Kevin Reid! that did the the trick :)
Post by 'Kevin Reid' via Google Caja Discuss
Post by o x
hello
i have a few iFrames loading the Caja lib..
so i have tried to load the lib from the parent page, but something get
wrong..
[...]
Post by o x
Uncaught TypeError: Cannot set property 'plugin_dispatchEvent___' of
undefined
at makeDomicileAndEmitter (ses-single-frame.js?debug=1:29542)
at Object.makeES5Frame (ses-single-frame.js?debug=1:29456)
at caja.js?_=1493711102536:264
In each of your frames, do
caja.initFeralFrame(window);
before calling caja.load, and this should work.
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-caja-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...