|
@@ -18,7 +18,7 @@ $( "#1" ).click(function() {
|
|
success: function (res) {
|
|
success: function (res) {
|
|
var myJSON = JSON.stringify(res);
|
|
var myJSON = JSON.stringify(res);
|
|
// var a = res;
|
|
// var a = res;
|
|
- console.log(res);
|
|
|
|
|
|
+ // console.log(res);
|
|
var d = JSON.parse(myJSON);
|
|
var d = JSON.parse(myJSON);
|
|
console.log(d[0].name);
|
|
console.log(d[0].name);
|
|
},
|
|
},
|
|
@@ -30,16 +30,72 @@ $( "#1" ).click(function() {
|
|
});
|
|
});
|
|
|
|
|
|
$( "#2" ).click(function() {
|
|
$( "#2" ).click(function() {
|
|
- alert( "瑜珈" );
|
|
|
|
|
|
+ $.ajax('http://172.105.205.52:8000/tags', {
|
|
|
|
+ type: 'GET', // http method
|
|
|
|
+ headers: { 'Access-Control-Allow-Origin': '*' },
|
|
|
|
+ success: function (res) {
|
|
|
|
+ var myJSON = JSON.stringify(res);
|
|
|
|
+ // var a = res;
|
|
|
|
+ // console.log(res);
|
|
|
|
+ var d = JSON.parse(myJSON);
|
|
|
|
+ console.log(d[1].name);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ error: function (err) {
|
|
|
|
+ console.log(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
$( "#3" ).click(function() {
|
|
$( "#3" ).click(function() {
|
|
- alert( "科技" );
|
|
|
|
|
|
+ $.ajax('http://172.105.205.52:8000/tags', {
|
|
|
|
+ type: 'GET', // http method
|
|
|
|
+ headers: { 'Access-Control-Allow-Origin': '*' },
|
|
|
|
+ success: function (res) {
|
|
|
|
+ var myJSON = JSON.stringify(res);
|
|
|
|
+ // var a = res;
|
|
|
|
+ // console.log(res);
|
|
|
|
+ var d = JSON.parse(myJSON);
|
|
|
|
+ console.log(d[2].name);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ error: function (err) {
|
|
|
|
+ console.log(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
$( "#4" ).click(function() {
|
|
$( "#4" ).click(function() {
|
|
- alert( "商業" );
|
|
|
|
|
|
+ $.ajax('http://172.105.205.52:8000/tags', {
|
|
|
|
+ type: 'GET', // http method
|
|
|
|
+ headers: { 'Access-Control-Allow-Origin': '*' },
|
|
|
|
+ success: function (res) {
|
|
|
|
+ var myJSON = JSON.stringify(res);
|
|
|
|
+ // var a = res;
|
|
|
|
+ // console.log(res);
|
|
|
|
+ var d = JSON.parse(myJSON);
|
|
|
|
+ console.log(d[3].name);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ error: function (err) {
|
|
|
|
+ console.log(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
$( "#5" ).click(function() {
|
|
$( "#5" ).click(function() {
|
|
- alert( "自我成長" );
|
|
|
|
|
|
+ $.ajax('http://172.105.205.52:8000/tags', {
|
|
|
|
+ type: 'GET', // http method
|
|
|
|
+ headers: { 'Access-Control-Allow-Origin': '*' },
|
|
|
|
+ success: function (res) {
|
|
|
|
+ var myJSON = JSON.stringify(res);
|
|
|
|
+ // var a = res;
|
|
|
|
+ // console.log(res);
|
|
|
|
+ var d = JSON.parse(myJSON);
|
|
|
|
+ console.log(d[4].name);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ error: function (err) {
|
|
|
|
+ console.log(err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|