1 |
wakaba |
1.1 |
<!DOCTYPE html> |
2 |
|
|
<html lang="en"> |
3 |
|
|
<head> |
4 |
|
|
<title><iframe src="file://127.0.0.1/SharedDocs/"></title> |
5 |
|
|
</head> |
6 |
|
|
<body> |
7 |
|
|
<p><iframe src="file://127.0.0.1/SharedDocs/" width="10" height="10" id="iframe1">(iframe content)</iframe></p> |
8 |
|
|
|
9 |
|
|
<script type="text/javascript"> |
10 |
|
|
|
11 |
|
|
function htescape (s) { |
12 |
|
|
return s.replace ('&', '&').replace ('<', '<'); |
13 |
|
|
} // htescape |
14 |
|
|
|
15 |
|
|
function dumpValue (v) { |
16 |
|
|
if (typeof (v) == 'undefined') { |
17 |
|
|
document.write ('is <code>undefined</code>.'); |
18 |
|
|
} else if (v == null) { |
19 |
|
|
document.write ('is <code>null</code>.'); |
20 |
|
|
} else if (typeof (v) == 'string' && v == '') { |
21 |
|
|
document.write ('is an empty string.'); |
22 |
|
|
} else { |
23 |
|
|
document.write ('is of ' + htescape (typeof (v))); |
24 |
|
|
try { |
25 |
|
|
document.write (', with string value <code>' |
26 |
|
|
+ htescape (v.toString ()) + '</code>.'); |
27 |
|
|
} catch (e) { |
28 |
|
|
document.write (' whose string value is unknown: <q>' |
29 |
|
|
+ htescape (e.toString ()) + '</q>.'); |
30 |
|
|
} |
31 |
|
|
} |
32 |
|
|
} // dumpValue |
33 |
|
|
|
34 |
|
|
var iframe = document.getElementById ('iframe1'); |
35 |
|
|
|
36 |
|
|
document.write ('<p><code><var>iframe1</var>.contentDocument</code> '); |
37 |
|
|
dumpValue (iframe.contentDocument); |
38 |
|
|
|
39 |
|
|
document.write ('<p><code><var>iframe1</var>.contentWindow</code> '); |
40 |
|
|
dumpValue (iframe.contentWindow); |
41 |
|
|
|
42 |
|
|
if (iframe.contentWindow) { |
43 |
|
|
document.write ('<p><code><var>iframe1</var>.contentWindow.location</code> '); |
44 |
|
|
dumpValue (iframe.contentWindow.location); |
45 |
|
|
} |
46 |
|
|
</script> |
47 |
|
|
|
48 |
|
|
</body> |
49 |
|
|
</html> |