Add javascript after polling