質問編集履歴
1
エディタの修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,31 +7,31 @@
|
|
7
7
|
//1.ミルクココアインスタンスを作成
|
8
8
|
var milkcocoa = new MilkCocoa("id名");
|
9
9
|
|
10
|
-
|
10
|
+
$("#translate").on("click",function(){
|
11
|
-
|
11
|
+
$.ajax({
|
12
|
-
|
12
|
+
type: "GET",
|
13
|
-
|
13
|
+
url: "http://api.microsofttranslator.com/V2/Ajax.svc/Translate",
|
14
|
-
|
14
|
+
dataType: "jsonp",
|
15
|
-
|
15
|
+
data: {
|
16
|
-
|
16
|
+
client_id: 'dktky18',
|
17
|
-
|
17
|
+
client_secret:'axe19HoGCPTtdu1R3ycOoiVU7ajQDZXLeR8W1iV2jbQ=',
|
18
|
-
|
18
|
+
scope: 'http://api.microsofttranslator.com',
|
19
|
-
|
19
|
+
grant_type: 'client_credentials',
|
20
|
-
|
20
|
+
text: "Hello, world!",
|
21
|
-
|
21
|
+
from: "en",
|
22
|
-
|
22
|
+
to: "ja"
|
23
|
-
|
23
|
+
},
|
24
|
-
|
24
|
+
jsonp: "oncomplete",
|
25
|
-
//
|
25
|
+
//success: function (data, dataType) {
|
26
|
-
// // 結果を表示
|
27
|
-
// success: function(response){
|
28
|
-
// alert(response.status);
|
29
|
-
|
26
|
+
// 結果を表示
|
27
|
+
success: function(response){
|
28
|
+
alert(response.status);
|
29
|
+
},
|
30
|
-
|
30
|
+
error: function(response){
|
31
|
-
|
31
|
+
alert(response.responseText);
|
32
|
+
}
|
32
|
-
//
|
33
|
+
//}
|
33
|
-
// //}
|
34
|
-
|
34
|
+
});
|
35
35
|
|
36
36
|
|
37
37
|
```
|