<iframe not working in Edge, but works in Internet Explorer 11Remove border from IFrameHow to apply CSS to iframe?Invoking JavaScript code in an iframe from the parent pagejQuery/JavaScript: accessing contents of an iframelocation.hash inside iframe not working on FirefoxRemove vertical scroll bar from IFrame that gets rendered in Internet ExplorerSaving the content of an iFrame in MS EdgeEdge Browser - iframe.document.open not workingDisplaying Blob PDF in Edge/IE11Javascript inside iframe not working in Internet Explorer
Examples of fluid (including air) being used to transmit digital data?
Do I need transit visa for Dublin?
How to get the speed of my spaceship?
How do resistors generate different heat if we make the current fixed and changed the voltage and resistance? Notice the flow of charge is constant
Bringing coumarin-containing liquor into the USA
Are "confidant" and "confident" homophones?
Gory anime with pink haired girl escaping an asylum
PhD: When to quit and move on?
Do intermediate subdomains need to exist?
Can a USB hub be used to access a drive from two devices?
As a supervisor, what feedback would you expect from a PhD who quits?
Possibility to correct pitch from digital versions of records with the hole not centered
Computer name naming convention for security
My professor has told me he will be the corresponding author. Will it hurt my future career?
How to delete multiple process id of a single process?
Better random (unique) file name
Do Goblin tokens count as Goblins?
How do I explain how I handle unrealistic expectations from superiors in an interview?
Wouldn't putting an electronic key inside a small Faraday cage render it completely useless?
What is the highest level of accuracy in motion control a Victorian society could achieve?
Park the computer
Why do most airliners have underwing engines, while business jets have rear-mounted engines?
Shipped package arrived - didn't order, possible scam?
Did Stalin kill all Soviet officers involved in the Winter War?
Remove border from IFrameHow to apply CSS to iframe?Invoking JavaScript code in an iframe from the parent pagejQuery/JavaScript: accessing contents of an iframelocation.hash inside iframe not working on FirefoxRemove vertical scroll bar from IFrame that gets rendered in Internet ExplorerSaving the content of an iFrame in MS EdgeEdge Browser - iframe.document.open not workingDisplaying Blob PDF in Edge/IE11Javascript inside iframe not working in Internet Explorer
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a basic iframe embedding HTML content. I applied a workaround to get it to work in IE11, but doesn't work in Edge. Works great in Chrome and FireFox. Half of my users are on Edge...
<iframe
title="My iframe should work"
class="large"
id="my-slide-should-work"
src="javascript: window.frameElement.getAttribute('srcdoc');" // this fixed it for IE11
scrolling="no"
srcdoc='<!DOCTYPE html><html>all the goodness</html>'>
</iframe>
Edge just shows a blank space, errors out about the JS
SCRIPT5007: SCRIPT5007: Unable to get property 'getAttribute' of undefined or null reference
javascript: window.frameElement.getAttribute('srcdoc'); (1,2)
iframe microsoft-edge
add a comment |
I have a basic iframe embedding HTML content. I applied a workaround to get it to work in IE11, but doesn't work in Edge. Works great in Chrome and FireFox. Half of my users are on Edge...
<iframe
title="My iframe should work"
class="large"
id="my-slide-should-work"
src="javascript: window.frameElement.getAttribute('srcdoc');" // this fixed it for IE11
scrolling="no"
srcdoc='<!DOCTYPE html><html>all the goodness</html>'>
</iframe>
Edge just shows a blank space, errors out about the JS
SCRIPT5007: SCRIPT5007: Unable to get property 'getAttribute' of undefined or null reference
javascript: window.frameElement.getAttribute('srcdoc'); (1,2)
iframe microsoft-edge
add a comment |
I have a basic iframe embedding HTML content. I applied a workaround to get it to work in IE11, but doesn't work in Edge. Works great in Chrome and FireFox. Half of my users are on Edge...
<iframe
title="My iframe should work"
class="large"
id="my-slide-should-work"
src="javascript: window.frameElement.getAttribute('srcdoc');" // this fixed it for IE11
scrolling="no"
srcdoc='<!DOCTYPE html><html>all the goodness</html>'>
</iframe>
Edge just shows a blank space, errors out about the JS
SCRIPT5007: SCRIPT5007: Unable to get property 'getAttribute' of undefined or null reference
javascript: window.frameElement.getAttribute('srcdoc'); (1,2)
iframe microsoft-edge
I have a basic iframe embedding HTML content. I applied a workaround to get it to work in IE11, but doesn't work in Edge. Works great in Chrome and FireFox. Half of my users are on Edge...
<iframe
title="My iframe should work"
class="large"
id="my-slide-should-work"
src="javascript: window.frameElement.getAttribute('srcdoc');" // this fixed it for IE11
scrolling="no"
srcdoc='<!DOCTYPE html><html>all the goodness</html>'>
</iframe>
Edge just shows a blank space, errors out about the JS
SCRIPT5007: SCRIPT5007: Unable to get property 'getAttribute' of undefined or null reference
javascript: window.frameElement.getAttribute('srcdoc'); (1,2)
iframe microsoft-edge
iframe microsoft-edge
asked Mar 25 at 20:22
David LozziDavid Lozzi
2,7676 gold badges19 silver badges27 bronze badges
2,7676 gold badges19 silver badges27 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Looks like window.frameElement is NULL and because of that it is not able to get 'srcdoc' using getAttribute.
Below can be the possible reason why it is Null.
If the window isn't embedded into another document, or if the document
into which it's embedded has a different origin (such as having been
located from a different domain), this is null.
So you can try to check for the above mentioned criteria and I suggest you to create a script segment and try to check whether window.frameElement is Null or not. If it is not null than try use GetAttribute before assign its value to IFrame src.
Another thing you need to notice that srcdoc attribute is not supported in MS Edge. So MS Edge will not have any effect of that attribute.
References:
(1) Window.frameElement
(2) <'iframe'>: The Inline Frame element
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345838%2fiframe-not-working-in-edge-but-works-in-internet-explorer-11%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Looks like window.frameElement is NULL and because of that it is not able to get 'srcdoc' using getAttribute.
Below can be the possible reason why it is Null.
If the window isn't embedded into another document, or if the document
into which it's embedded has a different origin (such as having been
located from a different domain), this is null.
So you can try to check for the above mentioned criteria and I suggest you to create a script segment and try to check whether window.frameElement is Null or not. If it is not null than try use GetAttribute before assign its value to IFrame src.
Another thing you need to notice that srcdoc attribute is not supported in MS Edge. So MS Edge will not have any effect of that attribute.
References:
(1) Window.frameElement
(2) <'iframe'>: The Inline Frame element
add a comment |
Looks like window.frameElement is NULL and because of that it is not able to get 'srcdoc' using getAttribute.
Below can be the possible reason why it is Null.
If the window isn't embedded into another document, or if the document
into which it's embedded has a different origin (such as having been
located from a different domain), this is null.
So you can try to check for the above mentioned criteria and I suggest you to create a script segment and try to check whether window.frameElement is Null or not. If it is not null than try use GetAttribute before assign its value to IFrame src.
Another thing you need to notice that srcdoc attribute is not supported in MS Edge. So MS Edge will not have any effect of that attribute.
References:
(1) Window.frameElement
(2) <'iframe'>: The Inline Frame element
add a comment |
Looks like window.frameElement is NULL and because of that it is not able to get 'srcdoc' using getAttribute.
Below can be the possible reason why it is Null.
If the window isn't embedded into another document, or if the document
into which it's embedded has a different origin (such as having been
located from a different domain), this is null.
So you can try to check for the above mentioned criteria and I suggest you to create a script segment and try to check whether window.frameElement is Null or not. If it is not null than try use GetAttribute before assign its value to IFrame src.
Another thing you need to notice that srcdoc attribute is not supported in MS Edge. So MS Edge will not have any effect of that attribute.
References:
(1) Window.frameElement
(2) <'iframe'>: The Inline Frame element
Looks like window.frameElement is NULL and because of that it is not able to get 'srcdoc' using getAttribute.
Below can be the possible reason why it is Null.
If the window isn't embedded into another document, or if the document
into which it's embedded has a different origin (such as having been
located from a different domain), this is null.
So you can try to check for the above mentioned criteria and I suggest you to create a script segment and try to check whether window.frameElement is Null or not. If it is not null than try use GetAttribute before assign its value to IFrame src.
Another thing you need to notice that srcdoc attribute is not supported in MS Edge. So MS Edge will not have any effect of that attribute.
References:
(1) Window.frameElement
(2) <'iframe'>: The Inline Frame element
answered Mar 26 at 5:22
Deepak-MSFTDeepak-MSFT
1,7811 gold badge1 silver badge7 bronze badges
1,7811 gold badge1 silver badge7 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345838%2fiframe-not-working-in-edge-but-works-in-internet-explorer-11%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown