UPDATE 2016-11-16 9:53am EST
It appears many people are still seeing 204 responses even though Google has claimed to have \"fixed\" the problem. Wh
A simple solution/hack with Reactjs, though can be easily implemented to any other library/vanilla.
Used with a basic concept : tries to load - if onload accomplish, clear interval, otherwise try to load again every 3 sec. works perfectly
(I've edited my own code it so it will contain minimum code, so not tested)
var React = require('react');
export default class IframeGoogleDocs extends React.Component {
constructor(props) {
super();
this.bindActions();
}
bindActions() {
this.updateIframeSrc = this.updateIframeSrc.bind(this);
this.iframeLoaded = this.iframeLoaded.bind(this);
}
iframeLoaded() {
clearInterval(this.iframeTimeoutId);
}
getIframeLink() {
return `https://docs.google.com/gview?url=${this.props.url}`; // no need for this if thats not dynamic
}
updateIframeSrc() {
this.refs.iframe.src = this.getIframeLink();
}
componentDidMount() {
this.iframeTimeoutId = setInterval(
this.updateIframeSrc, 1000 * 3
);
}
render() {
return (
);
}
}