Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

jQuery 1.8 #170

Closed
Nerian opened this Issue Aug 18, 2012 · 1 comment

Comments

Projects
None yet
3 participants

Nerian commented Aug 18, 2012

Hi,

I upgraded to jQuery 1.8 and since then I get an error every time there is pjax call and it doesn't work.

Uncaught TypeError: Object #<Text> has no method 'getAttribute' jquery.js:4057

I am using Rails (3.2.8), jquery-rails (2.1.1), pjax-rails (head)

Full backtrack:

  Uncaught TypeError: Object #<Text> has no method 'getAttribute'         jquery.js:4057
  Sizzle.selectors.filter.ID.node                                         jquery.js:4057
  Sizzle.compile.cached                                                   jquery.js:4866
  select                                                                  jquery.js:4982
  select                                                                  jquery.js:5084
  Sizzle                                                                  jquery.js:3913
  Sizzle.matchesSelector                                                  jquery.js:5123
  jQuery.extend.filter                                                    jquery.js:5372
  jQuery.fn.extend.is                                                     jquery.js:5219
  (anonymous function)                                                    jquery.pjax.js:530
  jQuery.extend.each                                                      jquery.js:612
  jQuery.fn.jQuery.each                                                   jquery.js:242
  findAll                                                                 jquery.pjax.js:529
  extractContainer                                                        jquery.pjax.js:569
  options.success                                                         jquery.pjax.js:207
  jQuery.Callbacks.fire                                                   jquery.js:974
  jQuery.Callbacks.self.fireWith                                          jquery.js:1081
  done                                                                    jquery.js:7584
  jQuery.ajaxTransport.send.callback                                      jquery.js:8299

I think I'm seeing the same problem with jQuery 1.8.0. Specifically, I'm getting a "getAttribute is not a function" error from jQuery when I try to specify a fragment option in $.pjax.

I'm pretty sure it has to do with how the findAll() function is checking TextNodes when it loops through elems. I did a PR that refactors the findAll function() slightly, and it seemed to fix the problem for me.

@josh josh added a commit that referenced this issue Aug 21, 2012

@josh josh Merge pull request #171 from rudidude86/master
Refactored findAll(), fixes issue #170
40521f8

@josh josh closed this Aug 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment