Ticket #11442: test-iframe-innerhtml.html

File test-iframe-innerhtml.html, 629 bytes (added by Piotrek Koszuliński, 10 years ago)
Line 
1<!DOCTYPE html>
2<html>
3<head>
4        <meta charset="utf-8">
5        <title>Foo foo!</title>
6        <style>
7textarea {
8        height: 50px;
9        display: block;
10}
11        </style>
12</head>
13<body>
14        <script>
15
16var values = [ 'foo', 'f<o>o', 'f&lt;o&gt;o', 'f&amp;oo', 'f<!--o-->o' ],
17        value,
18        div = document.createElement( 'div' ),
19        textarea;
20
21while ( ( value = values.shift() ) ) {
22        div.innerHTML = '<iframe>' + value + '</iframe>'; // Setting innerHTML on iframe throws error on IE8.
23
24        textarea = document.createElement( 'textarea' );
25        textarea.value = value + '\n=>\n' + div.firstChild.innerHTML;
26        document.body.appendChild( textarea );
27}
28
29        </script>
30</body>
31</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy