Skip to content

Commit

Permalink
BUGFIX: get rid of arrow functions
Browse files Browse the repository at this point in the history
Oups...
  • Loading branch information
dimaip committed Apr 21, 2017
1 parent 7906995 commit 47a2ab8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Resources/Public/ajax.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
(function () {
var containers = document.querySelectorAll('[data-ajaxify]');

Array.from(containers).forEach(i => loadContainer(i));
[].slice.call.from(containers).forEach(function(el) {
loadContainer(el);
});

function loadContainer(container) {
var request = new XMLHttpRequest();
Expand All @@ -10,15 +12,13 @@

request.onload = function() {
if (request.status >= 200 && request.status < 400) {
// Success!
container.outerHTML = request.responseText;
} else {
container.innerHTML = 'Content failed to load, please refresh the page';
}
};

request.onerror = function() {
// There was a connection error of some sort
container.innerHTML = 'Content failed to load, please refresh the page';
};

Expand Down

0 comments on commit 47a2ab8

Please sign in to comment.