my_article.js 979 B

123456789101112131415161718192021222324252627282930313233
  1. function my_article_list() {
  2. $.get(
  3. "../article/list.php",
  4. {
  5. userid: getCookie("userid"),
  6. setting: "",
  7. },
  8. function (data, status) {
  9. if (status == "success") {
  10. try {
  11. let html = "";
  12. let result = JSON.parse(data);
  13. let key = 1;
  14. for (const iterator of result) {
  15. html += '<div class="file_list_row" style="padding:5px;">';
  16. html +=
  17. '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
  18. html += "<div style='flex:1;'>" + key++ + "</div>";
  19. html += "<div style='flex:2;'>" + iterator.title + "</div>";
  20. html += "<div style='flex:2;'>" + "</div>";
  21. html += "<div style='flex:1;'>15</div>";
  22. html += "</div>";
  23. }
  24. $("#article_list").html(html);
  25. } catch (e) {
  26. console.error(e);
  27. }
  28. } else {
  29. console.error("ajex error");
  30. }
  31. }
  32. );
  33. }