diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-09-15 16:27:24 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-09-15 16:27:24 -0400 |
commit | 24f99305fcda201f67c8de846bb2d683011099b7 (patch) | |
tree | 756eaf0f95a332ae7076c61efff8d1ee8133e0e7 /lib | |
parent | 6b1c568299c1625ea0f1441268b17aee37930c5c (diff) |
Filters displaying properly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index a1179231..b1046aa6 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -304,20 +304,22 @@ function dyn(pnode, s) { runScripts(dummy); var table = x.parentNode; - var arr = dummy.getElementsByTagName("tbody"); - firstChild = null; - var tbody; - if (arr.length > 0 && table != null) - tbody = arr[0]; - else - tbody = dummy; - - var next; - firstChild = document.createElement("script"); - table.insertBefore(firstChild, x); - for (var node = tbody.firstChild; node; node = next) { - next = node.nextSibling; - table.insertBefore(node, x); + if (table) { + var arr = dummy.getElementsByTagName("tbody"); + firstChild = null; + var tbody; + if (arr.length > 0 && table != null) + tbody = arr[0]; + else + tbody = dummy.firstChild; + + var next; + firstChild = document.createElement("script"); + table.insertBefore(firstChild, x); + for (var node = tbody.firstChild; node; node = next) { + next = node.nextSibling; + table.insertBefore(node, x); + } } } else if (pnode == "tr") { var dummy = document.createElement("body"); @@ -325,10 +327,16 @@ function dyn(pnode, s) { runScripts(dummy); var table = x.parentNode; - var arr = dummy.getElementsByTagName("tr"); - firstChild = null; - if (arr.length > 0 && table != null) { - var tbody = arr[0], next; + if (table) { + var arr = dummy.getElementsByTagName("tr"); + firstChild = null; + var tbody; + if (arr.length > 0 && table != null) + tbody = arr[0]; + else + tbody = dummy.firstChild; + + var next; firstChild = document.createElement("script"); table.insertBefore(firstChild, x); for (var node = tbody.firstChild; node; node = next) { |