Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <script src="//fb.me/react-with-addons-0.13.1.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var PDFViewer = React.createClass({  
    componentDidMount() {
        this.timeoutId = setInterval(
            this.onError, 1000 * 3
        );
    },
    
    onLoaded() {
        clearInterval(this.timeoutId);
    },
    
    getLink() {
        return `https://docs.google.com/viewer?url=https://www.apt2you.com/houseSaleDetailDownload.do?manageNo=2019000179&embedded=true`;
    },
    
    onError() {
        this.ref.src = this.getLink();
    },
    render: function() {
        return (
            <iframe onLoad={this.onLoaded} onError={this.onError}  src={this.getLink()} ref={(el) => { this.ref = el; }}></iframe>
        );
    }
});
 
React.render(<PDFViewer />, document.body);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
DongHyunKimspro
0viewers