<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;








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)









share|improve this question




























    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)









    share|improve this question
























      0












      0








      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)









      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      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






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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






          share|improve this answer






















            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            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






            share|improve this answer



























              0














              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






              share|improve this answer

























                0












                0








                0







                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






                share|improve this answer













                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                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


















                    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.



















                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript