From f02302696e063a67b76ba8dd928ca949b2604311 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 13 Aug 2012 07:50:29 -0400 Subject: [PATCH] if element (js/css) will not loaded it would be removed from DOM tree and error image would be shown --- client.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/client.js b/client.js index 699bb22c..698317ea 100644 --- a/client.js +++ b/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;