Fix hasOwnProperty

This commit is contained in:
Michel Roux 2014-10-27 12:32:35 +01:00
parent 123d80bdb8
commit bd8378159f

View File

@ -17,8 +17,10 @@ function callRequest(action, section, message) {
var buttons = document.querySelectorAll('#' + section + ' button'); var buttons = document.querySelectorAll('#' + section + ' button');
for (var button in buttons) { for (var button in buttons) {
if (buttons.hasOwnProperty(button)) {
buttons[button].disabled = true; buttons[button].disabled = true;
} }
}
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', 'ajax.php'); xhr.open('POST', 'ajax.php');
@ -39,8 +41,10 @@ function callRequest(action, section, message) {
} }
for (var button in buttons) { for (var button in buttons) {
if (buttons.hasOwnProperty(button)) {
buttons[button].disabled = false; buttons[button].disabled = false;
} }
}
document.querySelector('#' + section + ' input').value = ''; document.querySelector('#' + section + ' input').value = '';
} }
}; };