Bug Tracker

Modify

Ticket #7355 (closed bug: invalid)

Opened 3 years ago

Last modified 2 years ago

wrapInner has no effect on IE8

Reported by: zackw@… Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by rwaldron) (diff)

demonstrates what I believe to be a bug with wrapInner and IE8. (The fiddle makes use of jquery.ui.accordion, but this is only because that's how I noticed; the bug is with wrapInner.)

For an accordion to work correctly, the elements selected by the "header" parameter to .accordion() must have contents that meet a particular structure. Since this structure is not semantically meaningful, I wanted to create it on the fly rather than write it into the HTML. I do this with a call to wrapInner immediately before the invocation of accordion(). This works correctly on every other browser I've tried, but IE seems to silently ignore the wrapInner call. You can see that this is the case by comparing the rendered result pane in IE to that in any other browser - in IE the accordion headings are narrower, and the text is being drawn on top of the twisty triangles.

Change History

comment:1 Changed 3 years ago by zackw@…

I should probably have said that I have only tried this in IE8 but rather expect it is a generic IE bug.

comment:2 Changed 3 years ago by jitter

This isn't bug as far as I'm concerned.

You pass in a string to wrapInner which isn't well formed HTML. Just changing it fixes your problem in IE. (Well atleast for me in IE6)

wrapInner("<a href=\"#\">") //doesn't work
wrapInner("<a href=\"#\" />") //works
wrapInner("<a href=\"#\"></a>") //works too

comment:3 Changed 3 years ago by zackw@…

OK, but then you should make it clearer in the documentation that, when passing a string, tags must be closed. Right now, the only thing that even slightly implies that is an example,

$('.inner').wrapInner('<div class="new" />');

which, when I read that, I assume the /> is a pointless XMLism and using just an opening tag is supposed to work.

comment:4 Changed 3 years ago by jitter

OK, but then you should make it clearer in the documentation

you who? I'm not on the jQuery team or anything like that. Just a user like you

comment:5 Changed 3 years ago by rwaldron

  • Keywords docfix added
  • Status changed from new to closed
  • Resolution set to invalid
  • Description modified (diff)

thanks again jitter

comment:6 Changed 3 years ago by snover

  • Keywords needsdocs added; docfix removed

comment:7 follow-up: ↓ 8 Changed 2 years ago by addyosmani

  • Keywords needsdocs removed

I've just updated the docs on this as follows:

Note: When passing a selector string to the .wrapInner() function, the expected input is well formed HTML with correctly closed tags. Valid input includes:

$(elem).wrapInner("<div class='test' />"); $(elem).wrapInner("<div class='test'></div>"); $(elem).wrapInner("<div class=\"test\"></div>");

comment:8 in reply to: ↑ 7 Changed 2 years ago by zackw@…

Replying to addyosmani:

I've just updated the docs on this as follows:

Note: When passing a selector string to the .wrapInner() function, [...]

"selector string" is CSS terminology; suggest "HTML fragment", or just "string". Otherwise this looks like a good change. Thanks.

comment:9 Changed 2 years ago by cd.wharton@…

I think this bug is back - cannot get it to work in IE9 at all!

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.