Added js folder. Wrote a js to refresh page only when page is visible to save database quota.