Add active class to resultitem and fix JS error

Signed-off-by: Kaustav Das Modak <kaustav.dasmodak@yahoo.co.in>