| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|---|
| 2 | <html xmlns="http://www.w3.org/1999/xhtml">
|
|---|
| 3 | <head>
|
|---|
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|---|
| 5 | <title>Thead clone won't work in MSIE</title>
|
|---|
| 6 | <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
|
|---|
| 7 | </head>
|
|---|
| 8 |
|
|---|
| 9 | <body>
|
|---|
| 10 |
|
|---|
| 11 | <div id="container">
|
|---|
| 12 |
|
|---|
| 13 | <table>
|
|---|
| 14 |
|
|---|
| 15 | <thead>
|
|---|
| 16 |
|
|---|
| 17 | <tr>
|
|---|
| 18 |
|
|---|
| 19 | <td>lorem ipsum</td>
|
|---|
| 20 |
|
|---|
| 21 | </tr>
|
|---|
| 22 |
|
|---|
| 23 | </thead>
|
|---|
| 24 |
|
|---|
| 25 | <tbody><td>dolor color</td></tbody>
|
|---|
| 26 |
|
|---|
| 27 | <tfoot>
|
|---|
| 28 |
|
|---|
| 29 | <tr>
|
|---|
| 30 |
|
|---|
| 31 | <td>and a footer</td>
|
|---|
| 32 |
|
|---|
| 33 | </tr>
|
|---|
| 34 |
|
|---|
| 35 | </tfoot>
|
|---|
| 36 |
|
|---|
| 37 | </table>
|
|---|
| 38 |
|
|---|
| 39 | </div>
|
|---|
| 40 |
|
|---|
| 41 | <script type="text/javascript">
|
|---|
| 42 |
|
|---|
| 43 | var tableElement='td'
|
|---|
| 44 |
|
|---|
| 45 | //table = ok
|
|---|
| 46 | //thead = buggy
|
|---|
| 47 | //tfoot = buggy
|
|---|
| 48 | //tbody = buggy
|
|---|
| 49 | //tr = buggy
|
|---|
| 50 | //td = buggy
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 | var jQueryclonedTable=$('#container '+tableElement).clone().get(0);
|
|---|
| 54 | alert(jQueryclonedTable.innerHTML);
|
|---|
| 55 | var DOMclonedTable=document.getElementById('container').getElementsByTagName(tableElement).item(0).cloneNode(true);
|
|---|
| 56 | alert(DOMclonedTable.innerHTML);
|
|---|
| 57 |
|
|---|
| 58 | </script>
|
|---|
| 59 |
|
|---|
| 60 | </body>
|
|---|
| 61 | </html>
|
|---|