Opened 13 years ago
Closed 12 years ago
#6598 closed bug (patchwelcome)
TypeError: Result of expression 'div.style' [null] is not an object when loading using XSLT
Reported by: | kevinpeno | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | |
Component: | support | Version: | 1.4.4 |
Keywords: | xml xsl xslt needsreview | Cc: | |
Blocked by: | Blocking: |
Description
When loading jquery via an xslt page, Safari 4.0.4 (531.21.10), the latest windows build, throws the following error:
TypeError: Result of expression 'div.style' [null] is not an object.
See attached files for test case.
Attachments (2)
Change History (16)
Changed 13 years ago by
comment:1 Changed 13 years ago by
Also verified that this affects FF 3.6.3 as well. IE 6+ is not affected.
comment:2 Changed 13 years ago by
I found a few more things through research today that I think should be taken into consideration when resolving this bug. Please see the references below:
Forum post with the same issue: http://forum.jquery.com/topic/using-jquery-from-an-xslt-throws-error-is-undefined-after-that
2008 mailing list message regarding a fix to this issue: http://groups.google.com/group/jquery-en/msg/a86c35b90d143c4f
GitHub submission containing a hack to workaround this issue until it is resolved: http://gist.github.com/352210
Thanks!
comment:3 Changed 13 years ago by
Component: | unfiled → manipulation |
---|
comment:5 Changed 12 years ago by
Keywords: | xml xslt added |
---|---|
Priority: | → undecided |
comment:7 Changed 12 years ago by
Version: | 1.4.2 → 1.4.4 |
---|
comment:9 Changed 12 years ago by
Keywords: | xsl added |
---|---|
Summary: | TypeError: Result of expression 'div.style' [null] is not an object. → TypeError: Result of expression 'div.style' [null] is not an object when loading using XSLT |
comment:10 follow-up: 11 Changed 12 years ago by
More details available in ticket 4264 (why are the older XSLT namespace bugs are being marked as duplicates of the newer ones?)
comment:11 follow-up: 13 Changed 12 years ago by
Replying to snover:
But does anyone care…?
I'll provide a patch as soon as I have some time. I assume that will expedite the resolution? Is there anything else I should supply with the patch that will help with getting this resolved and/or approved for a future release?
Replying to dvdckl:
More details available in ticket 4264 (why are the older XSLT namespace bugs are being marked as duplicates of the newer ones?)
Hey! Thanks for the reference to your ticket (which is far more comprehensible than mine). I've altered my local copy of http://gist.github.com/352210 to add the code below and it resolves all errors with all browsers when using jQuery with namespaces (XHTML) and/or using XSLT. I did note, however, that, unlike you, I did not suffer from document.body issues in webkit browsers. This has likely been fixed recently because I recall having issues with them in the past regarding document.body.
Also, if you haven't, make sure you vote this ticket up ;)
// XSLT causes Gecko and Webkit to not set document.body if( !document.body ) document.body = document.documentElement.getElementsByTagName("body")[0];
comment:13 Changed 12 years ago by
Replying to kevinpeno:
Is there anything else I should supply with the patch that will help with getting this resolved and/or approved for a future release?
Adequate unit tests must be added to the jQuery Test Suite. Your tests must pass 100% in at least the following:
- Chrome 5
- Safari 3+
- Firefox 3.0.12, 3.5, 3.6, 4
- IE 6+
- Opera 10.60+
comment:14 Changed 12 years ago by
Component: | manipulation → support |
---|---|
Resolution: | → patchwelcome |
Status: | new → closed |
I don't think that this is something that we're going to reasonably fix. If a patch with a pull request is issued, pleased feel free to re-open this and we can take a look. Thanks!
XML file a user would access