Test with onreadystatechange instead of onload