summaryrefslogtreecommitdiffstats
path: root/usr/local/www/javascript/index
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@sullrich-MacBookPro.local>2009-03-08 18:10:04 -0400
committerScott Ullrich <sullrich@sullrich-MacBookPro.local>2009-03-08 18:10:04 -0400
commit5f00df88bdbc32a6843be5b5810059af9081d957 (patch)
tree5fb7f55ba016ec53a5bae5f453b337123bd1bb4d /usr/local/www/javascript/index
parent7a2154f63719495879401ee55e80f8f4e11ef480 (diff)
downloadpfsense-5f00df88bdbc32a6843be5b5810059af9081d957.zip
pfsense-5f00df88bdbc32a6843be5b5810059af9081d957.tar.gz
Test to make sure items exist before trying to get their properties
Diffstat (limited to 'usr/local/www/javascript/index')
-rw-r--r--usr/local/www/javascript/index/sajax.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/usr/local/www/javascript/index/sajax.js b/usr/local/www/javascript/index/sajax.js
index 36bd7ca..edf3b4d 100644
--- a/usr/local/www/javascript/index/sajax.js
+++ b/usr/local/www/javascript/index/sajax.js
@@ -32,18 +32,22 @@ function stats(x) {
function updateMemory(x)
{
- document.getElementById("memusagemeter").value = x + '%';
-
- document.getElementById("memwidtha").style.width = x + 'px';
- document.getElementById("memwidthb").style.width = (100 - x) + 'px';
+ if($('memusagemeter'))
+ document.getElementById("memusagemeter").value = x + '%';
+ if($('memwidtha'))
+ document.getElementById("memwidtha").style.width = x + 'px';
+ if($('memwidthb'))
+ document.getElementById("memwidthb").style.width = (100 - x) + 'px';
}
function updateCPU(x)
{
- document.getElementById("cpumeter").value = x + '%';
-
- document.getElementById("cpuwidtha").style.width = x + 'px';
- document.getElementById("cpuwidthb").style.width = (100 - x) + 'px';
+ if($('cpumeter'))
+ document.getElementById("cpumeter").value = x + '%';
+ if($('cpuwidtha'))
+ document.getElementById("cpuwidtha").style.width = x + 'px';
+ if($('cpuwidthb'))
+ document.getElementById("cpuwidthb").style.width = (100 - x) + 'px';
}
function updateTemp(x)
@@ -65,12 +69,14 @@ function updateDateTime(x) {
function updateUptime(x)
{
- document.getElementById("uptime").value = x;
+ if($('uptime'))
+ document.getElementById("uptime").value = x;
}
function updateState(x)
{
- document.getElementById("pfstate").value = x;
+ if($('pfstate'))
+ document.getElementById("pfstate").value = x;
}
function updateInterfaceStats(x){
OpenPOWER on IntegriCloud