Reordering table rows through jQuery giving unwanted results in IE

I am trying to rearrange table rows in a preformatted HTML table. The HTML table is displayed in the same way as in the script below. My generic HTML is listed in this fiddle.

Initial view of the table

I am trying to rearrange <td> with texts containing the texts "One" and "Two". I identify these lines as "One" and "Two" using the attribute "rowspan". If you see the script below in a browser without IE, you can get a clear idea of โ€‹โ€‹what I'm trying to do.

After adjustment

But the problem is that this code works fine in browsers other than IE (I tested in Chrome and Firefox). I can not find where the problem is ...

Please help me fix my code to be compatible with the browser.

+6
source share
2 answers

Thanks for your answers, I found a problem. IE assigns an index of 1 element. So giving

find('td.mrGridCategoryText:eq(0)') 

gives unwanted results. If I change it to 1, I get the correct result in IE, but not in others. Check out this script http://jsfiddle.net/J7WPb/23/
So,

  i need to give eq(0) if other browsers and eq(1) if IE :-( 

Thanks again.

+3
source

If you can, use IE9 (Windows 7+ only) and press "F12" for the console and debugging capabilities.

Then you can even use the javascript debugger to refresh the page and break it into javascript errors.

Personally, I do not support IE, but not until they start supporting the "Internet" as any other "better browser" does.

UPDATE

I found a problem! When IE8 loads the page, an error appears on line 195 of the LayoutCM.js file

In other words, I do not think that the error in your code is as strong as the jFiddle problem! Suffice it to say that IE8 does not support "getStyle" for the object it is called on (the "win" variable is expected as a "window").
This is another striking example of IE that does not support the Internet, as I put it earlier.

We hope this information helps!

+1
source

Source: https://habr.com/ru/post/900526/


All Articles