Skip to main content

Bug Tracker

Side navigation

#7355 closed bug (invalid)

Opened October 30, 2010 01:38AM UTC

Closed October 30, 2010 11:24PM UTC

Last modified March 30, 2011 10:25AM UTC

wrapInner has no effect on IE8

Reported by: zackw@panix.com Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

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.

Attachments (0)
Change History (9)

Changed October 30, 2010 01:41AM UTC by zackw@panix.com comment:1

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

Changed October 30, 2010 10:23AM UTC by jitter comment:2

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

Changed October 30, 2010 03:02PM UTC by zackw@panix.com comment:3

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.

Changed October 30, 2010 09:45PM UTC by jitter comment:4

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

Changed October 30, 2010 11:24PM UTC by rwaldron comment:5

description: http://jsfiddle.net/pPuVL/3/ 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. 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.
keywords: → docfix
resolution: → invalid
status: newclosed

thanks again jitter

Changed October 31, 2010 08:16AM UTC by snover comment:6

keywords: docfixneedsdocs

Changed March 01, 2011 06:31AM UTC by addyosmani comment:7

keywords: needsdocs

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>");

Changed March 01, 2011 04:09PM UTC by zackw@panix.com comment:8

Replying to [comment:7 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.

Changed March 30, 2011 10:25AM UTC by cd.wharton@gmail.com comment:9

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