1 | <html> |
---|
2 | <head> |
---|
3 | <title>iframe window test</title> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
5 | <script type="text/javascript" src="jquery-1.3.2.js"></script> |
---|
6 | <script type="text/javascript"> |
---|
7 | |
---|
8 | $( function() { |
---|
9 | |
---|
10 | var iframeWindow = $("iframe")[0].contentWindow; |
---|
11 | iframeWindow.name = "iframeWindow"; |
---|
12 | window.name = "window"; |
---|
13 | |
---|
14 | $([ iframeWindow, window ]).each( function() { |
---|
15 | var name = this.name; |
---|
16 | $( this ).resize( function() { |
---|
17 | $("<p/>") |
---|
18 | .text( "This should be appended to " + name ) |
---|
19 | .appendTo( this.document.body ); |
---|
20 | }) |
---|
21 | }) |
---|
22 | }) |
---|
23 | |
---|
24 | </script> |
---|
25 | </head> |
---|
26 | <body> |
---|
27 | <p>Resize this window to test.</p> |
---|
28 | <iframe style='width: 100%'></iframe> |
---|
29 | </body> |
---|
30 | </html> |
---|