summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-03-11 18:32:26 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-03-11 18:32:26 -0400
commit98509219b32b38ff39d7d97710144df9daeee6d9 (patch)
tree6f852d5df141d08680b73eb127537437ad9bf5af
parent4f94e09fcbaca1d79d689141578bdb21628d5971 (diff)
downloadpfsense-98509219b32b38ff39d7d97710144df9daeee6d9.zip
pfsense-98509219b32b38ff39d7d97710144df9daeee6d9.tar.gz
Ensure that the gateway widget exists before populating data during ajax calls.
-rw-r--r--usr/local/www/javascript/index/sajax.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/local/www/javascript/index/sajax.js b/usr/local/www/javascript/index/sajax.js
index 20da997..ffe1843 100644
--- a/usr/local/www/javascript/index/sajax.js
+++ b/usr/local/www/javascript/index/sajax.js
@@ -87,8 +87,10 @@ function updateGatewayStats(x){
gateways_split = x.split(",");
var counter = 1;
for (var y=0; y<gateways_split.length-1; y++){
- document.getElementById('gateway' + counter).innerHTML = gateways_split[y];
- counter++;
+ if($('gateway' + counter)) {
+ document.getElementById('gateway' + counter).innerHTML = gateways_split[y];
+ counter++;
+ }
}
}
}
@@ -98,8 +100,10 @@ function updateInterfaceStats(x){
statistics_split = x.split(",");
var counter = 1;
for (var y=0; y<statistics_split.length-1; y++){
- document.getElementById('stat' + counter).innerHTML = statistics_split[y];
- counter++;
+ if($('stat' + counter)) {
+ document.getElementById('stat' + counter).innerHTML = statistics_split[y];
+ counter++;
+ }
}
}
}
OpenPOWER on IntegriCloud