power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Missing script/stylesheet file(s) halt(s) callback processing #408

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
r3010 blocks on any script files and/or stylesheets that fail to download 
properly - either because they're missing or because for ex. their download 
times out. In such a situation not only the affected files, but also any other 
files that were supposed to be loaded after them won't be loaded, neither will 
any of the script blocks get executed, thus practically halting the processing 
of the callback response. 

Event though under normal circumstances no referenced script or stylesheet 
files should be missing and/or fail to download, but if they do, the framework 
should attempt to make the best out of the situation, and not halt, as absence 
of the affected resource itself might not be a fatal issue by itself.

The problem only affects browsers that do not fire the <script> or <link 
rel="stylesheet"> elements' onreadystatechange event in the case the resource 
fails to load properly. (So for ex. IE is not affected by this issue, while 
Opera and most mobile browsers are). 

The attached patch fixes this issue by hooking also onto the onerror event of 
said elements, and proceeding with the load of any additional resources even 
then, if one of them fails to load for any reason. If this happens, it also 
tries to log the error to the (javascript) console, thus making the developer 
aware of the missing resource.

Original issue reported on code.google.com by google...@pcforum.hu on 17 Jun 2012 at 12:07

Attachments:

GoogleCodeExporter commented 8 years ago
committed as r3166, thank you

Original comment by ctrlal...@gmail.com on 19 Jun 2012 at 3:26