Skip to content

Commit 5be6466

Browse files
committed
Opens a sample document with Google Docs API in iframe.
1 parent 36bea86 commit 5be6466

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

viewer/index.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Load iFrame</title>
5+
</head>
6+
7+
<body>
8+
<div id="marker"></div>
9+
<script type="text/javascript">
10+
var ifrm = document.createElement('iframe');
11+
ifrm.setAttribute('id', 'ifrm'); // assign an id
12+
ifrm.setAttribute('style', "border: 0; position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;");
13+
ifrm.setAttribute('name', "ifrm");
14+
15+
//document.body.appendChild(ifrm); // to place at end of document
16+
17+
// to place before another page element
18+
var el = document.getElementById('marker');
19+
el.parentNode.insertBefore(ifrm, el);
20+
21+
// assign url
22+
ifrm.setAttribute('src', 'https://docs.google.com/viewer?url=http://www.snee.com/xml/xslt/sample.doc&embedded=true&chrome=true&dov=1');
23+
24+
document.getElementsByName('ifrm')[0].onload = function(){
25+
document.title = window.frames.ifrm.document.title;
26+
};
27+
</script>
28+
</body>
29+
</html>

0 commit comments

Comments
 (0)