It does work in an onLoad client script.