Module: nagvis Branch: master Commit: 1622c7bc7f63a60eb6523673fd064f95b53e1ff6 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=1622c7bc7f63a60eb6523673fd064f95b53e1ff6
Author: Lars Michelsen <[email protected]> Date: Thu Aug 19 18:01:21 2010 +0200 Removed some javascript error messages which could occur on automatic page reload --- share/frontend/nagvis-js/js/NagVisShape.js | 6 ++++-- share/frontend/nagvis-js/js/NagVisTextbox.js | 7 ++++--- share/frontend/nagvis-js/js/ajax.js | 6 ++++-- share/frontend/nagvis-js/js/dynfavicon.js | 5 ++++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/share/frontend/nagvis-js/js/NagVisShape.js b/share/frontend/nagvis-js/js/NagVisShape.js index 4182495..af3412e 100644 --- a/share/frontend/nagvis-js/js/NagVisShape.js +++ b/share/frontend/nagvis-js/js/NagVisShape.js @@ -55,10 +55,12 @@ var NagVisShape = NagVisStatelessObject.extend({ this.remove(); var oMap = document.getElementById('map'); - this.parsedObject = oMap.appendChild(oContainerDiv); + if(oMap) { + this.parsedObject = oMap.appendChild(oContainerDiv); + oMap = null; + } oContainerDiv = null; - oMap = null; }, /** diff --git a/share/frontend/nagvis-js/js/NagVisTextbox.js b/share/frontend/nagvis-js/js/NagVisTextbox.js index 63fc5c8..766601a 100644 --- a/share/frontend/nagvis-js/js/NagVisTextbox.js +++ b/share/frontend/nagvis-js/js/NagVisTextbox.js @@ -58,10 +58,11 @@ var NagVisTextbox = NagVisStatelessObject.extend({ this.remove(); var oMap = document.getElementById('map'); - this.parsedObject = oMap.appendChild(oContainerDiv); - + if(oMap) { + this.parsedObject = oMap.appendChild(oContainerDiv); + oMap = null; + } oContainerDiv = null; - oMap = null; }, /** diff --git a/share/frontend/nagvis-js/js/ajax.js b/share/frontend/nagvis-js/js/ajax.js index 9bb0801..988d5fd 100644 --- a/share/frontend/nagvis-js/js/ajax.js +++ b/share/frontend/nagvis-js/js/ajax.js @@ -172,15 +172,17 @@ function getAsyncRequest(sUrl, bCacheable, callback, callbackParams) { } else if(responseText.match(/^NagVisError:/)) { frontendMessage(eval('( '+responseText.replace(/^NagVisError:/, '')+')')); } else { + var oResponse = null; try { - callback(eval('( '+responseText+')'), callbackParams); + oResponse = eval('( '+responseText+')') if(bCacheable) updateQueryCache(sUrl, iNow, responseText); } catch(e) { jsonError("Exception: " + e.description + "\nTime: " + iNow + "\nURL: " + sUrl + "\nResponse: " + responseText); } - + if(oResponse) + callback(oResponse, callbackParams); } responseText = null; diff --git a/share/frontend/nagvis-js/js/dynfavicon.js b/share/frontend/nagvis-js/js/dynfavicon.js index b249e0e..3278d07 100644 --- a/share/frontend/nagvis-js/js/dynfavicon.js +++ b/share/frontend/nagvis-js/js/dynfavicon.js @@ -37,9 +37,12 @@ var favicon = { removeLinkIfExists: function() { var docHead = document.getElementsByTagName("head")[0]; var links = docHead.getElementsByTagName("link"); + + if(!docHead || !links) + return false; for (var i=0, len = links.length; i<len; i++) { - if (links[i].type == "image/x-icon" && links[i].rel == "shortcut icon") { + if (links[i] && links[i].type == "image/x-icon" && links[i].rel == "shortcut icon") { docHead.removeChild(links[i]); } } ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
