Add js function addLoadEvent()