Seems like IE is stucked in one of the while loops, but I can't figure
out why.
Anyone got a hint?

On Nov 17, 9:49 am, hagbardceline <[email protected]> wrote:
> Hi
>
> The following script works fine on FF but crashes IE (7 + 8).
>
> ---------------------------------------------------------------------
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en-us">
> <head>
>
> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
> <script type="text/javascript"
> src="http://tablesorter.com/jquery-latest.js";></script>
> <script type="text/javascript">
>
> jQuery(function(){
>
>    var nodes = new Array();
>    nodes = $(".modAccordion").children();
>    $(".modAccordion").children().remove();
>
>    var i = 0;
>    var headerTest = /.(Head)./;
>
>    while(i < nodes.length)
>    {
>       var testNode = nodes[i].toString();
>
>       if((testNode.match(headerTest))){
>          $(".modAccordion").append(nodes[i]);
>          i++;
>
>          var newDiv = document.createElement("div");
>          newDiv.className="new";
>
>          while(i < nodes.length && !((nodes[i].toString()).match
> (headerTest)))
>          {
>             newDiv.appendChild(nodes[i]);
>             i++;
>          }
>          $(".modAccordion").append(newDiv);
>       }
>
>    }
>
> });
>
> </script>
> <style>
> div.new
> {
>    background: #00ff00;
>
> }
>
> .modAccordion
> {
>    background: #ff0000;
>
> }
>
> </style>
> <title>TableSorter</title>
> </head>
> <body>
> <div class="modAccordion">
>   <h3>header 1</h3>
>    <p>some text</p>
>    <p>some other text</p>
>   <h3>header 2</h3>
>    <p>some text</p>
>    <ul>
>      <li>list element 1</li>
>      <li>list element 2</li>
>    </ul>
>   <h3>header 3</h3>
>    <p>some text</p>
>    <p>some other text</p>
>    <p>some more text</p>
>    <p>some different text</p>
> </div>
> </body>
> </html>
> ----------------------------------------------------------------------
>
> Anyone knows how to fix for IE?
>
> Thx in advance,
> hagbard

Reply via email to