Ticket #3870 (closed bug: fixed)
Cannot use jQuery 1.3 in XUL pages
| Reported by: | glazou | Owned by: | john |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.3.1 |
| Component: | core | Version: | 1.3 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
This is a regression from 1.2.6 to 1.3. I am using 1.2.6 in BlueGriffon (XUL- and Gecko-based wysiwyg editor) and it works absolutely fine. But attaching jQuery 1.3 to a XUL page results in the following error, horking completely the page's behaviour :
Error: div.firstChild.getAttribute is not a function Line: 2123
This line number is of course in the "development" version, not the minified one.
Attachments
Change History
comment:2 Changed 4 years ago by arrix
There is html specific code in jQuery, especially in jQuery.support. I think jQuery is mainly intended for html developers though it's been working quite well with XUL and XML until 1.3. I think XUL developers may need a jquery-xul fork which will definitely become Firefox extension developer's power tool.
comment:3 Changed 4 years ago by john
- Status changed from new to closed
- Resolution set to fixed
This should be fixed now in jQuery rev [6135].
comment:4 Changed 4 years ago by pausebuttonedit
Still not working for me. Firebug says the element created by selectors.js line 702 is of type 'Comment' (nodename '#comment', nodetype 8). It seems that this type of element doesn't support getAttribute(), so the script fails with 'div.firstChild.getAttribute is not a function'. I've attached an amended selectors.js; to wit, I've added '&& div.firstChild.getAttribute' to line 703.
First time I've used Trac, so let me know if I'm Doing It Wrong.
comment:5 Changed 4 years ago by john
Landed a fix for this in SVN rev [6161]. I just pushed a new nightly as well: http://code.jquery.com/nightlies/jquery-2009-01-23.js
comment:6 Changed 2 years ago by Ilya Kharlamov
There is a special branch of jQuery for use in xul: http://www.imaitech.com/jquery-xul/jquery-xul-1.4.5pre-1/jquery-xul.js
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


After doing some digging it looks like this is a very similar issue to #3864.