goto.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // axios
  2. // axios.get('http://172.105.205.52:8000/courses?tag_string=(2)')
  3. // .then(function (response) {
  4. // console.log(response);
  5. // });
  6. // axios.post('/user', {
  7. // firstName: 'Fred',
  8. // lastName: 'Flintstone'
  9. // }).then(function (response) {
  10. // console.log(response);
  11. // })
  12. $( "#1" ).click(function() {
  13. $.ajax('http://172.105.205.52:8000/tags', {
  14. type: 'GET', // http method
  15. headers: { 'Access-Control-Allow-Origin': '*' },
  16. success: function (res) {
  17. var myJSON = JSON.stringify(res);
  18. // var a = res;
  19. // console.log(res);
  20. var d = JSON.parse(myJSON);
  21. console.log(d[0].name);
  22. },
  23. error: function (err) {
  24. console.log(err);
  25. }
  26. });
  27. });
  28. $( "#2" ).click(function() {
  29. $.ajax('http://172.105.205.52:8000/tags', {
  30. type: 'GET', // http method
  31. headers: { 'Access-Control-Allow-Origin': '*' },
  32. success: function (res) {
  33. var myJSON = JSON.stringify(res);
  34. // var a = res;
  35. // console.log(res);
  36. var d = JSON.parse(myJSON);
  37. console.log(d[1].name);
  38. },
  39. error: function (err) {
  40. console.log(err);
  41. }
  42. });
  43. });
  44. $( "#3" ).click(function() {
  45. $.ajax('http://172.105.205.52:8000/tags', {
  46. type: 'GET', // http method
  47. headers: { 'Access-Control-Allow-Origin': '*' },
  48. success: function (res) {
  49. var myJSON = JSON.stringify(res);
  50. // var a = res;
  51. // console.log(res);
  52. var d = JSON.parse(myJSON);
  53. console.log(d[2].name);
  54. },
  55. error: function (err) {
  56. console.log(err);
  57. }
  58. });
  59. });
  60. $( "#4" ).click(function() {
  61. $.ajax('http://172.105.205.52:8000/tags', {
  62. type: 'GET', // http method
  63. headers: { 'Access-Control-Allow-Origin': '*' },
  64. success: function (res) {
  65. var myJSON = JSON.stringify(res);
  66. // var a = res;
  67. // console.log(res);
  68. var d = JSON.parse(myJSON);
  69. console.log(d[3].name);
  70. },
  71. error: function (err) {
  72. console.log(err);
  73. }
  74. });
  75. });
  76. $( "#5" ).click(function() {
  77. $.ajax('http://172.105.205.52:8000/tags', {
  78. type: 'GET', // http method
  79. headers: { 'Access-Control-Allow-Origin': '*' },
  80. success: function (res) {
  81. var myJSON = JSON.stringify(res);
  82. // var a = res;
  83. // console.log(res);
  84. var d = JSON.parse(myJSON);
  85. console.log(d[4].name);
  86. },
  87. error: function (err) {
  88. console.log(err);
  89. }
  90. });
  91. });
  92. // jquery
  93. // $(document).ready(function () {
  94. // $.ajax('http://172.105.205.52:8000/tags', {
  95. // type: 'GET', // http method
  96. // headers: { 'Access-Control-Allow-Origin': '*' },
  97. // success: function (res) {
  98. // var myJSON = JSON.stringify(res);
  99. // // var a = res;
  100. // console.log(res);
  101. // var d = JSON.parse(myJSON);
  102. // console.log("start");
  103. // console.log(d);
  104. // console.log(d[0].name);
  105. // console.log("end");
  106. // },
  107. // error: function (err) {
  108. // console.log(err);
  109. // }
  110. // });
  111. // $("#submit").bind('click', function () {
  112. // var idiom = $("#idiom").val();
  113. // });
  114. // });
  115. // $.get("date-time.php", function(data){
  116. // console.log(res);
  117. // });
  118. $(".slider1").slick({
  119. dots: true,
  120. dotsClass: 'slick-dots',
  121. speed: 1000,
  122. });