Endless pagging in object oriented javascript