javascript - JQuery applying change for each select element in a div section -
i getting following error:
typeerror: callback.call not function
value = callback.call(obj[i], i, obj[i]);
with following code:
$("#pagingdetails select").each($(this).change(refreshsearchresults)); $("#peoplesearchfilter select").each($(this).change(refreshsearchresults)); $("#peoplesearchfilter input:checkbox").each($(this).click(refreshsearchresults));
where function refreshsearchresults
makes ajax request server new search results based on search criteria or paging provided user through select
, checkbox
elements in thepagingdetails
div , personsearchfilter
div.
what don't wrong?
thanks,
-frinny
you not need loop stack, can bind on jquery object
$("#pagingdetails select").change(refreshsearchresults); $("#peoplesearchfilter select").change(refreshsearchresults); $("#peoplesearchfilter input:checkbox").click(refreshsearchresults);
also, documentation say, .each()
need function argument, not "action".
for future reference, working code (event if useless) :
$('selector').each(function(){ $(this).change(function); })
Comments
Post a Comment