Created
December 2, 2017 16:53
-
-
Save gutierri/200e9a8d18c22fda6b1ef8f5d74ce321 to your computer and use it in GitHub Desktop.
for .. of .. obj
This file contains 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() { | |
let print_selectors = [ | |
{selector: '.graphs_alfa', url: 'https://httpbin.org/uuid'}, | |
{selector: '.graphs_beta', url: 'https://httpbin.org/uuid'}, | |
{selector: '.graphs_gama', url: 'https://httpbin.org/uuid'} | |
]; | |
for (let _obj_print_selectors of print_selectors) { | |
$.ajax({ | |
url: _obj_print_selectors.url, | |
success: function(data) { | |
$(_obj_print_selectors.selector).html(data.uuid) | |
} | |
}) | |
} | |
}); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Alfa, Beta, Gama</title> | |
<meta charset="utf-8"> | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | |
<script type="text/javascript" src="html_dom_writter_ajax.js"></script> | |
</head> | |
<body> | |
<div class="graphs_alfa"></div> | |
<div class="graphs_beta"></div> | |
<div class="graphs_gama"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment