Skip to content

Instantly share code, notes, and snippets.

@saurav28
Created January 29, 2021 13:34

Revisions

  1. @saurav-sarkar-1 saurav-sarkar-1 renamed this gist Jan 29, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @saurav-sarkar-1 saurav-sarkar-1 created this gist Jan 29, 2021.
    32 changes: 32 additions & 0 deletions Google Docs UI in iframe
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    <!DOCTYPE html>
    <html>
    <head>
    <title>SDM Google Integration</title>
    <style>
    body {
    background-color: black;
    text-align: center;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    }
    </style>
    </head>
    <body>

    <h1>Embedding google doc as an iframe</h1>

    <script>
    function prepareFrame(docid) {
    var ifrm = document.createElement("IFRAME");
    var src = "https://docs.google.com/document/d/" + docid + "/edit?embedded=true"
    ifrm.setAttribute("src", src);
    ifrm.style.width = "100vw";
    ifrm.style.height = "100vh";

    document.body.appendChild(ifrm);
    }
    prepareFrame('<pass the google id of a document owned by you');
    </script>
    </body>

    </html>