2
0

article.js 853 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. var _articel_id = "";
  2. var _channal = "";
  3. var _lang = "";
  4. var _author = "";
  5. var _display = "";
  6. function articel_load(id) {
  7. if (id == "") {
  8. return;
  9. }
  10. $.get(
  11. "../article/get.php",
  12. {
  13. id: id,
  14. setting: "",
  15. },
  16. function (data, status) {
  17. if (status == "success") {
  18. try {
  19. let result = JSON.parse(data);
  20. if (result) {
  21. $("#article_title").html(result.title);
  22. $("#article_subtitle").html(result.subtitle);
  23. $("#article_author").html(
  24. result.username.nickname + "@" + result.username.username
  25. );
  26. $("#contents").html(note_init(result.content));
  27. note_refresh_new();
  28. }
  29. } catch (e) {
  30. console.error(e);
  31. }
  32. } else {
  33. console.error("ajex error");
  34. }
  35. }
  36. );
  37. }