Add callbacks for javascript finishing loading