[javascript] How to tell if a <script> tag failed to load