Use addEventListener/attachEvent instead of onload