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:
coderaiser 2012-08-13 07:50:29 -04:00
parent b94f618009
commit f02302696e

View file

@ -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;