Advertisement
Guest User

Untitled

a guest
May 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <style>
  2. #adoricDynamicContent li {
  3. width: auto;
  4. height: 150px;
  5. overflow: hidden;
  6. float: left;
  7. list-style-type: none;
  8. margin-left: 60px;
  9. }
  10. </style>
  11. <ul id="adoricDynamicContent"></ul>
  12. <script>
  13. var gameTags = document.querySelector('#gameTags a');
  14. var href = gameTags.getAttribute('href');
  15.  
  16. if (gameTags && href) {
  17. var data = null;
  18. var xhr = new XMLHttpRequest();
  19.  
  20. xhr.withCredentials = true;
  21.  
  22. xhr.addEventListener("readystatechange", function () {
  23. if (this.readyState === 4) {
  24. var response = JSON.parse(this.response);
  25. var html = '';
  26.  
  27. if (response.list && response.list.length) {
  28. for (var i = 0; i < 3; i++) {
  29. if (response.list[i]) {
  30. 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>'
  31. }
  32. }
  33. }
  34.  
  35. document.getElementById('adoricDynamicContent').innerHTML = html;
  36. }
  37. });
  38.  
  39. xhr.open("GET", "https://www.gogy.com/public/cache/listings" + href + ".json");
  40. xhr.setRequestHeader("Content-Type", "application/json");
  41. xhr.setRequestHeader("cache-control", "no-cache");
  42.  
  43. xhr.send(data);
  44. }
  45. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement