Inside the school_page.html I have container with class .novices, where the template with data is placed to.
This works fine, hovewer I cannot get list of .card, because all tries to log it invokes before context is executed.
console.log($('.card')) gives Object { length: 0, prevObject: {…} } either I use second .then or this.after(). When i check $('.card') in the console, after all being rendered I have list of elements as I want to. The deal, I want bind event (click) to all of .cardelements, as soon as they have inserted. Please, advise (^-')
Hello. Sorry this is not an issue, but question how this organized in sammy.js.
This is a template:
this code in
main.js
fileInside the
school_page.html
I have container with class.novices
, where the template with data is placed to. This works fine, hovewer I cannot get list of.card
, because all tries to log it invokes before context is executed.console.log($('.card'))
givesObject { length: 0, prevObject: {…} }
either I use second.then
orthis.after()
. When i check$('.card')
in the console, after all being rendered I have list of elements as I want to. The deal, I want bind event (click) to all of.card
elements, as soon as they have inserted. Please, advise (^-')