回答編集履歴

2

書式の改善

2016/02/26 09:47

投稿

pencil
pencil

スコア34

test CHANGED
@@ -12,6 +12,26 @@
12
12
 
13
13
  ```ここに言語を入力
14
14
 
15
+ <!DOCTYPE HTML>
16
+
17
+ <html>
18
+
19
+ <head>
20
+
21
+ <meta charset="utf-8">
22
+
23
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
24
+
25
+ <meta http-equiv="Content-Security-Policy" content="default-src * data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
26
+
27
+ <link rel="stylesheet" href="components/loader.css">
28
+
29
+ <link rel="stylesheet" href="css/style.css">
30
+
31
+ <script src="components/loader.js"></script>
32
+
33
+ <script src="js/ncmb-2.0.0.min.js"></script>
34
+
15
35
  <script>
16
36
 
17
37
 
@@ -20,9 +40,9 @@
20
40
 
21
41
  //mBaaSの初期化
22
42
 
23
- var application_key = "アプリケーションキーを入力";
43
+ var application_key = "アプリケーションキー";
24
44
 
25
- var client_key = "クライアントキーを入力";
45
+ var client_key = "クライアントキー";
26
46
 
27
47
  var ncmb = new NCMB(application_key, client_key);
28
48
 
@@ -40,7 +60,7 @@
40
60
 
41
61
 
42
62
 
43
- // ユーザー名とパスワードでログイン
63
+ // ユーザー名とパスワードでログインここがちがう
44
64
 
45
65
  ncmb.User.login(username, password)
46
66
 
@@ -70,7 +90,7 @@
70
90
 
71
91
  .then(function(){
72
92
 
73
- // ログイン
93
+ // ログイン
74
94
 
75
95
  ncmb.User.login(username,password)
76
96
 
@@ -80,7 +100,7 @@
80
100
 
81
101
  alert("新規登録&ログイン成功");
82
102
 
83
- })
103
+ });
84
104
 
85
105
  });
86
106
 
@@ -100,4 +120,64 @@
100
120
 
101
121
  </script>
102
122
 
123
+ <style>
124
+
125
+ body{
126
+
127
+ background-color: #BBDEFB;
128
+
129
+ padding-top: 20px;
130
+
131
+ font-family: Verdana, sans-serif;
132
+
133
+ }
134
+
135
+ form{
136
+
137
+ padding: 30px auto;
138
+
139
+ text-align: center;
140
+
141
+ }
142
+
143
+ input{
144
+
145
+ border-radius: 5px;
146
+
147
+ padding: 7px;
148
+
149
+ margin-bottom: 10px;
150
+
151
+ width: 200px;
152
+
153
+ font-size: 20px;
154
+
155
+ }
156
+
157
+ </style>
158
+
159
+ </head>
160
+
161
+ <body>
162
+
163
+
164
+
165
+ <form>
166
+
167
+ <input type="text" id="username" placeholder="User name" />
168
+
169
+ <input type="password" id="password" placeholder="Password" />
170
+
171
+ <input type="submit" value="Register/Login" />
172
+
173
+ </form>
174
+
175
+
176
+
177
+ </body>
178
+
179
+ </html>
180
+
181
+
182
+
103
183
  ```

1

文法の修正

2016/02/26 09:47

投稿

pencil
pencil

スコア34

test CHANGED
@@ -1,8 +1,12 @@
1
- 元の動画
1
+ これ上手くいくみたいでした。
2
2
 
3
- ログインが失敗した時に新規登録処理が入っているので、それを書きましょう。
4
3
 
4
+
5
+ こういうjavascriptの問題では、catch句の中で
6
+
7
+ alert(err);
8
+
5
- 動画チュトリアルは、とばして視聴せずに忠実に追っていくようにて進めていようにすると確実だと思います
9
+ を実行したときエラメッセージも記載しておくと回答やすると思います
6
10
 
7
11
 
8
12