mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
if element (js/css) will not loaded it would be removed from DOM tree and error image would be shown
This commit is contained in:
parent
b94f618009
commit
f02302696e
1 changed files with 14 additions and 8 deletions
22
client.js
22
client.js
|
|
@ -230,17 +230,23 @@ CloudClient.Util = (function(){
|
|||
}else if (typeof lFunc === 'object') {
|
||||
if(lFunc.onload &&
|
||||
typeof lFunc.onload === 'function')
|
||||
element.onload = lFunc.onload;
|
||||
element.onload = lFunc.onload;
|
||||
}
|
||||
|
||||
/* if element (js/css) will not loaded
|
||||
* it would be removed from DOM tree
|
||||
* and error image would be shown
|
||||
*/
|
||||
element.onerror = (function(){
|
||||
(pParams_o.element || document.body)
|
||||
.removeChild(element);
|
||||
|
||||
Util.Images.showError();
|
||||
|
||||
if(lFunc.onerror &&
|
||||
typeof lFunc.onerror === 'function')
|
||||
element.onerror = (function(){
|
||||
(pParams_o.element || document.body)
|
||||
.removeChild(element);
|
||||
|
||||
lFunc.onerror();
|
||||
});
|
||||
}
|
||||
lFunc.onerror();
|
||||
});
|
||||
|
||||
if(pParams_o.style){
|
||||
element.style.cssText=pParams_o.style;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue