updated javascript after page loading