Server side onload functionality in multiple docs. Fixed #1623