I'm very beginner in javascript and right now im learning from railscast. I have problem how to write this script, writen in coffee script to normal JS. Can somebody do this:
jQuery ->
if $('.pagination').length
$(window).scroll ->
url = $('.pagination .next_page').attr('href')
if url && $(window).scrollTop() > $(document).height() - $(window).height() - 50
$('.pagination').text("Fetching more products...")
$.getScript(url)
$(window).scroll()
$('.tooltip').tooltipster(
animation: 'grow'
);
I try with " jQuery(function($) { " but it doesnt work.
coffee -c file.coffee