load_something.js 858 B

1234567891011121314151617181920212223242526
  1. function load_user_info(name) {
  2. var url = "/api/user_info/" + encodeURI(name) + "?render=1";
  3. var xhr = new XMLHttpRequest();
  4. xhr.open("GET", url, true);
  5. xhr.send(null);
  6. xhr.onreadystatechange = function() {
  7. if(this.readyState === 4 && this.status === 200) {
  8. document.getElementById('get_user_info').innerHTML += JSON.parse(this.responseText)['data'];
  9. }
  10. }
  11. }
  12. function load_ver() {
  13. var url = "/api/version";
  14. var xhr = new XMLHttpRequest();
  15. xhr.open("GET", url, true);
  16. xhr.send(null);
  17. xhr.onreadystatechange = function() {
  18. if(this.readyState === 4 && this.status === 200) {
  19. document.getElementById('ver_send').innerHTML += JSON.parse(this.responseText)['lastest_version'];
  20. document.getElementById('ver_send').style.display = "list-item";
  21. }
  22. }
  23. }