Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded Google Document in IFRAME sometimes doesn't load

Tags:

html

iframe

I have a very frustrating problem with Google viewer, which is displaying a PDF that is embedded within an IFFRAME on my website.

The really strange thing is, that very occasionally the content does not load and the part of the screen where the IFRAME should be displayed is just blank. If I then hit the refresh button within my browser, the content displays just fine! Sometimes I can view the page 10 or 20 times before getting a blank screen.

Has anyone experienced anything similar in the past, and are there any suggestions for a remedy?

Many thanks and best regards.

like image 681
user3931836 Avatar asked Apr 14 '16 15:04

user3931836


People also ask

Can you iframe a Google Doc?

Embedding iFrames from Google Docs or Google Sheets 1. Copy the Google Doc or Sheets link from the URL bar. 2. Start a new iFrame block in the Card.

How do I view iframe files in Google Docs?

Open your Google Document (or other Google item). Under the "File" menu, click "Publish to the Web". Copy the "iframe" code. On the page you want the Google Doc embedded, click on "Source Code" button from the WYSIWYG editor to open the HTML editor.

Can you iframe Google Sheets?

Now you can simply copy that iframe code and place it in the HTML of the page you want to embed it into. The live sheet will appear on the page wherever you place it. If you're using WordPress, embedding code in WordPress means that you need to enter actual HTML code into your page copy.

Can you embed a Google Doc in HTML?

Copy the embed code. In your site editor, add a new "App Store & HTML" section by clicking on "Add new section" from the left panel. Mouse over the newly added section, click "Edit" and select "HTML". Paste the embed code you got from your Google Doc into the HTML box and click "Save".


1 Answers

I have solved the problem...

I was calling each page in turn using a get request linked to a php file, for example:

file.php?document=1
file.php?document=2

etc. etc....

I am now loading each page as an individual file and it seems to have solved the problem.

file1.php
file2.php

Thanks for your help anyway. It's always appreciated.

My very best regards.

like image 86
user3931836 Avatar answered Oct 21 '22 05:10

user3931836