Bug Tracker

Modify

Ticket #9906 (closed bug: invalid)

Opened 22 months ago

Last modified 22 months ago

Strange behavior with wrap() in IE and Mozilla

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

Example included for better understanding:

 http://jsfiddle.net/3xBcy/

<table class="grid" border="1">
    <tr>
        <th>Column 1</th>
        <th>Column 2</th>
    </tr>
    <tr>
        <td>Content 1</td>
        <td>Content 2</td>
    </tr>
</table>

I try to get the TABLE tag with a parent function

var table = $('.grid tr:first').parent();

This means, get the parent of the first line from a table with the class "grid" assigned to it ("$('.grid table)" won't work btw.), which is the table itself.

Now trying to wrap the table in a DIV tag fails in IE 8 and ends up with a strange behavior in Mozilla.

table.wrap(div); 

But if you try to do the same with

$('table').wrap(div);

everything is fine ...

The variable "table" seems to be a valid element. This code work:

table.hide(1000); 

Change History

comment:1 Changed 22 months ago by rwaldron

  • Status changed from new to closed
  • Resolution set to invalid

IE wraps trs in a tbody  http://jsfiddle.net/rwaldron/bV6Wd/ use closest("table")

Support questions should be directed to the support forum

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.