updating widgets javascript