Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

$.fn.filter fails when the collection includes the document #141

Closed
johnbender opened this issue Apr 8, 2017 · 0 comments
Closed

$.fn.filter fails when the collection includes the document #141

johnbender opened this issue Apr 8, 2017 · 0 comments
Assignees
Milestone

Comments

@johnbender
Copy link
Contributor

An example from snapper:

https://github.com/filamentgroup/snapper/blob/master/src/snapper.js#L292

$( document ).bind( "enhance", function( e ){
  $( "." + pluginName, e.target ).add( e.target ).filter( "." + pluginName )[ pluginName ]();
});

The e.target in this case is the document. An exception occurs here:

https://github.com/filamentgroup/shoestring/blob/master/src/dom/filter.js#L27

Where it attempts to append the document to the document fragment and the browser throws an exception.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants