10 examples of 'iframe onload' in JavaScript

Every line of 'iframe onload' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
166function iframeOnload() {
167 // 移除提交数据用的表单和iframe
168 if (div.parentNode) { div.parentNode.removeChild(div); }
169 // 释放全局回调函数
170 if (callbackName) { base.deleteGlobalVar(callbackName); }
171
172 onload('success');
173}
86onLoad_() {
87 const iframeElem = this.iframeElem_;
88
89 const src = iframeElem.attr('src');
90 if (!src) {
91 // Ignore unwanted load event that is fired when appending to DOM
92 return;
93 }
94 if (src === IframeContent.EMPTY_SRC) {
95 return;
96 }
97
98 const elem = this.getFlexibleElement();
99 elem.width(this.preferredWidth_);
100 elem.height(this.preferredHeight_);
101
102 this.onComplete_(true);
103}
209onLoadIframe() {
210 console.log("iframe onload");
211 let iframe = document.querySelector('#iframe') as HTMLIFrameElement
212 if (iframe.src == 'http://localhost:3000/') {
213 iframe.style.display = "none";
214 } else {
215 iframe.style.display = "block";
216 (document.querySelector('#loading') as HTMLElement).style.display = "none";
217 (document.querySelector('mat-progress-bar') as HTMLElement).style.display = "none";
218 }
219
220}
78function isLoaded(iframe, callback) {
79 if (iframe.contentDocument.readyState !== 'complete') {
80 iframe.addEventListener('load', function() {
81 callback();
82 });
83 } else {
84 callback();
85 }
86}
44function onload() {
45 var x = document.getElementsByTagName('a');
46 for (var i=0; i
24export function createIframe(onIframeLoad) {
25 var iframe = document.createElement('iframe');
26 iframe.class = 'react-playground-preview-iframe';
27 iframe.src = 'about:blank';
28 iframe.style.border = 'none';
29 iframe.style.zIndex = 2147483647;
30 iframe.style.margin = 0;
31 iframe.style.padding = 0;
32 iframe.style.width = '100%';
33 iframe.onload = onIframeLoad;
34 return iframe;
35}
8xhr.onload = function onLoad(evt) {
9 if (xhr.status === 200 || xhr.status === 0) {
10 cb(null, xhr.response);
11 } else {
12 cb(xhr.status);
13 }
14};
43target.addEventListener('load', function onload () {
44 resolve(blob);
45}, {once: true} as any); // hack
56img.onload = function onLoad() {
57 ctx.drawImage(img, 0, 0);
58 const jpeg = canvas.toDataURL('image/jpeg', 1.0);
59 downloadImage(jpeg, options.filename);
60};
129win.addEventListener("load", function onLoad(evt)
130{
131 // load listener not necessary once https://bugzil.la/800677 is fixed
132 var win = evt.currentTarget;
133 win.removeEventListener("load", onLoad, false);
134 if (win.document.documentElement.getAttribute("windowtype") == "navigator:browser")
135 FirebugLoader.loadIntoWindow(win);
136}, false);

Related snippets