Working Javascript long poll

Signed-off-by: OwenPatey <owen_patey@hotmail.com>