File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments