質問編集履歴
1
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
XMLHttpRequest cannot load https://www.abc.jp/a
|
9
|
+
XMLHttpRequest cannot load https://www.abc.jp/api/getPlanList?&username=hogehoge&password=hogehoge&did=16&sid=29&ymd=20160805. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8100' is therefore not allowed access.
|
10
10
|
|
11
11
|
|
12
12
|
|
@@ -17,3 +17,51 @@
|
|
17
17
|
|
18
18
|
|
19
19
|
何卒よろしくお願いいたしますm(_ _)m
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
`$scope.search = function() {
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
var headers = {
|
28
|
+
|
29
|
+
'Access-Control-Allow-Origin' : '*',
|
30
|
+
|
31
|
+
'Access-Control-Allow-Methods' : 'POST, GET, OPTIONS, PUT',
|
32
|
+
|
33
|
+
'Content-Type': 'application/json',
|
34
|
+
|
35
|
+
'Accept': 'application/json'
|
36
|
+
|
37
|
+
};
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
$http({
|
46
|
+
|
47
|
+
method: 'GET',
|
48
|
+
|
49
|
+
url: "https://www.abc.jp/api/getPlanList?&username=hogehoge&password=hogehoge&did=16&sid=29&ymd=20160805",
|
50
|
+
|
51
|
+
headers:headers
|
52
|
+
|
53
|
+
}).then(function successCallback(response) {
|
54
|
+
|
55
|
+
// ok
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
}, function errorCallback(response) {
|
60
|
+
|
61
|
+
console.log(response);
|
62
|
+
|
63
|
+
});
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
`
|