MCPcopy Index your code
hub / github.com/processing/p5.js / createP5Iframe

Function createP5Iframe

test/js/p5_helpers.js:71–89  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

69export const P5_SCRIPT_TAG = '<script src="' + P5_SCRIPT_URL + '"></script>';
70
71export function createP5Iframe(html) {
72 html = html || P5_SCRIPT_TAG;
73
74 var elt = document.createElement('iframe');
75
76 document.body.appendChild(elt);
77 elt.style.visibility = 'hidden';
78
79 elt.contentDocument.open();
80 elt.contentDocument.write(html);
81 elt.contentDocument.close();
82
83 return {
84 elt: elt,
85 teardown: function() {
86 elt.parentNode.removeChild(elt);
87 }
88 };
89}

Callers 2

main.jsFile · 0.90
structure.jsFile · 0.90

Calls 2

removeChildMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected