topic_list_load.js 646 B

1234567891011121314151617181920212223
  1. function topic_list_load(topic_num, s_num, where) {
  2. var o_data = document.getElementById(where);
  3. var url = "/api/thread/" + String(topic_num) + "?render=1&num=" + String(s_num);
  4. var n_data = "";
  5. var num = 1;
  6. var xhr = new XMLHttpRequest();
  7. xhr.open("GET", url, true);
  8. xhr.send(null);
  9. xhr.onreadystatechange = function() {
  10. if(this.readyState === 4 && this.status === 200) {
  11. t_data = JSON.parse(this.responseText);
  12. for(key in t_data) {
  13. n_data += t_data[key]['data'];
  14. num = key;
  15. }
  16. o_data.innerHTML = n_data;
  17. }
  18. }
  19. }