From bd8378159fe7b2e74574d914d5cefffdea86600c Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Mon, 27 Oct 2014 12:32:35 +0100 Subject: [PATCH] Fix hasOwnProperty --- js/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/app.js b/js/app.js index a42e3dd..8075694 100644 --- a/js/app.js +++ b/js/app.js @@ -17,7 +17,9 @@ function callRequest(action, section, message) { var buttons = document.querySelectorAll('#' + section + ' button'); for (var button in buttons) { - buttons[button].disabled = true; + if (buttons.hasOwnProperty(button)) { + buttons[button].disabled = true; + } } var xhr = new XMLHttpRequest(); @@ -39,7 +41,9 @@ function callRequest(action, section, message) { } for (var button in buttons) { - buttons[button].disabled = false; + if (buttons.hasOwnProperty(button)) { + buttons[button].disabled = false; + } } document.querySelector('#' + section + ' input').value = ''; }