Use the "domready" JavaScript event in the back end