davestewart / jquery-populate

MIT License
6 stars 6 forks source link

* not working #3

Open davestewart opened 10 years ago

davestewart commented 10 years ago

Needed to change your if/else block for other selectors when getting the elements array, * wasn't working.

var elements = NULL;

if(tagName.match(/^(table|tbody)$/) != null) { selector = selector || 'tr'; elements = jQuery(selector, this); } else if(tagName.match(/^(ul|ol)$/) != null) { selector = selector || 'li'; elements = jQuery(selector, this); } else { elements = null jQuery(this); }

davestewart commented 10 years ago

That null there was an accident. Debugged it looks like this:

var elements = null;

if(tagName.match(/^(table|tbody)$/) != null) { selector = selector || 'tr'; elements = jQuery(selector, this); } else if(tagName.match(/^(ul|ol)$/) != null) { selector = selector || 'li'; elements = jQuery(selector, this); } else { elements = jQuery(this); }