javascript - How to phrase 'has not' in jquery? -
for page in our app there number of customers generated in list when page loaded. 1 scrolls down on page more customers generated towards bottom of list, , forth till 1 scrolls way down , there no more customers generate.
i trying check, within .on() function, if new generated customers @ bottom has clock icon, , if not add clock icon new customers. check:
var isclock = $(timepickers).parent().has('.clockicon').length ? '' : addclock; if (typeof isclock === 'function') { isclock(); }
the problem customers there start on page, of course have clock icon, because of customers have clock icon not adding of ones don't have 1 now. .has() makes more since, idea of .is() because of says on jquery website:
check current matched set of elements against selector, element, or jquery object , return true if @ least 1 of these elements matches given arguments.
and thats needed check if of customers don't have clock icon add it. cannot think of way use .is() instead thinking use .not() or not: see if of customers don't have clock icon run function. not sure how 'if not have something' not 'if not something'. know how this????
use not()
instead of has()
Comments
Post a Comment