Last active
September 8, 2015 10:15
-
-
Save des1roer/7488e68e4f81564c3cf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
//console.log(array); | |
var path = '<?php echo $path; ?>'; //путь к контролеру | |
for (var i = 0; i < array.length; i++) { | |
var elem = array[i]; | |
var url = path + "ajaxAll?val=" + encodeURIComponent(elem); | |
//console.log(elem, url); | |
(function (elem) { | |
$.ajax({ | |
type: "POST", | |
url: url, | |
dataType: "json", | |
success: function (data) { | |
//alert ($id); | |
document.getElementById(elem).innerHTML = data; //запись в ячейку | |
} | |
}); | |
})(elem); | |
// document.getElementById(elem).innerHTML = elem; //так нормально пишет в нужную ячейку | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment