js for cards view.