Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- #adoricDynamicContent li {
- width: auto;
- height: 150px;
- overflow: hidden;
- float: left;
- list-style-type: none;
- margin-left: 60px;
- }
- </style>
- <ul id="adoricDynamicContent"></ul>
- <script>
- var gameTags = document.querySelector('#gameTags a');
- var href = gameTags.getAttribute('href');
- if (gameTags && href) {
- var data = null;
- var xhr = new XMLHttpRequest();
- xhr.withCredentials = true;
- xhr.addEventListener("readystatechange", function () {
- if (this.readyState === 4) {
- var response = JSON.parse(this.response);
- var html = '';
- if (response.list && response.list.length) {
- for (var i = 0; i < 3; i++) {
- if (response.list[i]) {
- html += '<li><a href="https://www.gogy.com/' + response.list[i].url + '"><img style="margin-top: ' + -150 * i + 'px;" src="https://www.gogy.com/public/cache/' + response.list[i].thumbnail_url + '"></a></li>'
- }
- }
- }
- document.getElementById('adoricDynamicContent').innerHTML = html;
- }
- });
- xhr.open("GET", "https://www.gogy.com/public/cache/listings" + href + ".json");
- xhr.setRequestHeader("Content-Type", "application/json");
- xhr.setRequestHeader("cache-control", "no-cache");
- xhr.send(data);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement