質問編集履歴
10
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -160,140 +160,50 @@
|
|
160
160
|
|
161
161
|
|
162
162
|
|
163
|
+
|
164
|
+
|
165
|
+
```HTML
|
166
|
+
|
167
|
+
<!DOCTYPE HTML>
|
168
|
+
|
163
|
-
|
169
|
+
<html>
|
164
170
|
|
165
171
|
|
166
172
|
|
167
173
|
<head>
|
168
174
|
|
169
|
-
<title>
|
170
|
-
|
171
|
-
proof
|
172
|
-
|
173
|
-
|
175
|
+
<meta charset="utf-8">
|
176
|
+
|
174
|
-
|
177
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
178
|
+
|
175
|
-
|
179
|
+
<meta http-equiv="Content-Security-Policy" content="default-src * data: gap: content: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
|
180
|
+
|
176
|
-
|
181
|
+
<script src="components/loader.js"></script>
|
182
|
+
|
183
|
+
<link rel="stylesheet" href="components/loader.css">
|
184
|
+
|
185
|
+
<link rel="stylesheet" href="css/style.css">
|
186
|
+
|
187
|
+
<link rel="stylesheet" href="lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
|
188
|
+
|
177
|
-
|
189
|
+
<script src="lib/jquery/jquery-1.12.4.min.js"></script>
|
190
|
+
|
178
|
-
|
191
|
+
<script src="lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
179
|
-
|
197
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
180
|
-
|
198
|
+
|
181
|
-
|
199
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/encoding-japanese/1.0.30/encoding.min.js"></script>
|
200
|
+
|
201
|
+
|
182
202
|
|
183
203
|
</head>
|
184
204
|
|
185
205
|
|
186
206
|
|
187
|
-
<body>
|
188
|
-
|
189
|
-
<div class="proof">
|
190
|
-
|
191
|
-
名前:<span class="name">
|
192
|
-
|
193
|
-
</span>
|
194
|
-
|
195
|
-
<br> 住所:
|
196
|
-
|
197
|
-
<span class="address">
|
198
|
-
|
199
|
-
</span>
|
200
|
-
|
201
|
-
<br> 製品名:
|
202
|
-
|
203
|
-
<span class="productName">
|
204
|
-
|
205
|
-
</span>
|
206
|
-
|
207
|
-
<br>
|
208
|
-
|
209
|
-
<span class="qrcode">
|
210
|
-
|
211
|
-
</span>
|
212
|
-
|
213
|
-
</div>
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
<script>
|
220
|
-
|
221
|
-
// http://phpspot.org/blog/archives/2009/09/jqueryquerystri.html
|
222
|
-
|
223
|
-
function getUrlVars() {
|
224
|
-
|
225
|
-
var vars = [],
|
226
|
-
|
227
|
-
hash;
|
228
|
-
|
229
|
-
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
230
|
-
|
231
|
-
for (var i = 0; i < hashes.length; i++) {
|
232
|
-
|
233
|
-
hash = hashes[i].split('=');
|
234
|
-
|
235
|
-
vars.push(hash[0]);
|
236
|
-
|
237
|
-
vars[hash[0]] = decodeURIComponent(hash[1]);
|
238
|
-
|
239
|
-
}
|
240
|
-
|
241
|
-
return vars;
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
$(function () {
|
248
|
-
|
249
|
-
// クエリ文字列から値を取得
|
250
|
-
|
251
|
-
var queryString = getUrlVars();
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
// 値を設定
|
256
|
-
|
257
|
-
$('.proof .name').text(queryString.name);
|
258
|
-
|
259
|
-
$('.proof .address').text(queryString.address);
|
260
|
-
|
261
|
-
$('.proof .productName').text(queryString.productName);
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
var qrCodeText = [queryString.name, queryString.address, queryString.productName].join('、');
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
$('.qrcode').qrcode({
|
270
|
-
|
271
|
-
width: 80,
|
272
|
-
|
273
|
-
height: 80,
|
274
|
-
|
275
|
-
text: Encoding.convert(qrCodeText, 'sjis')
|
276
|
-
|
277
|
-
});
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
});
|
282
|
-
|
283
|
-
</script>
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
</body>
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
</html>
|
292
|
-
|
293
207
|
|
294
208
|
|
295
209
|
```
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
二つ目のコードは参考にさせていただいたコードになります。
|
9
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -290,6 +290,10 @@
|
|
290
290
|
|
291
291
|
</html>
|
292
292
|
|
293
|
-
|
293
|
+
|
294
294
|
|
295
295
|
```
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
二つ目のコードは参考にさせていただいたコードになります。
|
8
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -157,3 +157,139 @@
|
|
157
157
|
|
158
158
|
|
159
159
|
``````HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
```<html>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<head>
|
168
|
+
|
169
|
+
<title>
|
170
|
+
|
171
|
+
proof
|
172
|
+
|
173
|
+
</title>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
178
|
+
|
179
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
|
180
|
+
|
181
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/encoding-japanese/1.0.30/encoding.min.js"></script>
|
182
|
+
|
183
|
+
</head>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<body>
|
188
|
+
|
189
|
+
<div class="proof">
|
190
|
+
|
191
|
+
名前:<span class="name">
|
192
|
+
|
193
|
+
</span>
|
194
|
+
|
195
|
+
<br> 住所:
|
196
|
+
|
197
|
+
<span class="address">
|
198
|
+
|
199
|
+
</span>
|
200
|
+
|
201
|
+
<br> 製品名:
|
202
|
+
|
203
|
+
<span class="productName">
|
204
|
+
|
205
|
+
</span>
|
206
|
+
|
207
|
+
<br>
|
208
|
+
|
209
|
+
<span class="qrcode">
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<script>
|
220
|
+
|
221
|
+
// http://phpspot.org/blog/archives/2009/09/jqueryquerystri.html
|
222
|
+
|
223
|
+
function getUrlVars() {
|
224
|
+
|
225
|
+
var vars = [],
|
226
|
+
|
227
|
+
hash;
|
228
|
+
|
229
|
+
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
230
|
+
|
231
|
+
for (var i = 0; i < hashes.length; i++) {
|
232
|
+
|
233
|
+
hash = hashes[i].split('=');
|
234
|
+
|
235
|
+
vars.push(hash[0]);
|
236
|
+
|
237
|
+
vars[hash[0]] = decodeURIComponent(hash[1]);
|
238
|
+
|
239
|
+
}
|
240
|
+
|
241
|
+
return vars;
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
$(function () {
|
248
|
+
|
249
|
+
// クエリ文字列から値を取得
|
250
|
+
|
251
|
+
var queryString = getUrlVars();
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
// 値を設定
|
256
|
+
|
257
|
+
$('.proof .name').text(queryString.name);
|
258
|
+
|
259
|
+
$('.proof .address').text(queryString.address);
|
260
|
+
|
261
|
+
$('.proof .productName').text(queryString.productName);
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
var qrCodeText = [queryString.name, queryString.address, queryString.productName].join('、');
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
$('.qrcode').qrcode({
|
270
|
+
|
271
|
+
width: 80,
|
272
|
+
|
273
|
+
height: 80,
|
274
|
+
|
275
|
+
text: Encoding.convert(qrCodeText, 'sjis')
|
276
|
+
|
277
|
+
});
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
});
|
282
|
+
|
283
|
+
</script>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</body>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
</html>
|
292
|
+
|
293
|
+
コード
|
294
|
+
|
295
|
+
```
|
7
コードフォーマットの整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -154,6 +154,6 @@
|
|
154
154
|
|
155
155
|
});
|
156
156
|
|
157
|
-
|
157
|
+
|
158
158
|
|
159
159
|
``````HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
6
コードフォーマットの整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
```javascript
|
2
2
|
|
3
|
-
|
3
|
+
var applicationkey = "00d239b7e135bedb216bb35159e5e111a9538adee21f5d5d3e1bbd9ef3d7f82a";
|
4
4
|
|
5
5
|
var clientkey = "d7c623a691bca31142aa99f53b77b9ca5515a4aaacc61d77e2a5bf8a07177c20";
|
6
6
|
|
5
コードフォーマットの整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
```javascript
|
2
|
+
|
1
3
|
```var applicationkey = "00d239b7e135bedb216bb35159e5e111a9538adee21f5d5d3e1bbd9ef3d7f82a";
|
2
4
|
|
3
5
|
var clientkey = "d7c623a691bca31142aa99f53b77b9ca5515a4aaacc61d77e2a5bf8a07177c20";
|
@@ -118,19 +120,19 @@
|
|
118
120
|
|
119
121
|
// 値を設定
|
120
122
|
|
121
|
-
|
123
|
+
$('.form-row .name').text(queryString.name);
|
122
124
|
|
123
|
-
|
125
|
+
$('.form-row .address').text(queryString.address);
|
124
126
|
|
125
|
-
|
127
|
+
$('.form-row .gender').text(queryString.gender);
|
126
128
|
|
127
|
-
|
129
|
+
$('.form-row .escape').text(queryString.escape);
|
128
130
|
|
129
|
-
|
131
|
+
$('.form-row .nursing').text(queryString.nursing);
|
130
132
|
|
131
|
-
|
133
|
+
$('.form-row .allergy').text(queryString.allergy);
|
132
134
|
|
133
|
-
|
135
|
+
$('.form-row .birthday').text(queryString.birthday);
|
134
136
|
|
135
137
|
|
136
138
|
|
4
コードフォーマットの整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -155,159 +155,3 @@
|
|
155
155
|
コード
|
156
156
|
|
157
157
|
``````HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
158
|
-
|
159
|
-
```JavaScript
|
160
|
-
|
161
|
-
```var applicationkey = "00d239b7e135bedb216bb35159e5e111a9538adee21f5d5d3e1bbd9ef3d7f82a";
|
162
|
-
|
163
|
-
var clientkey = "d7c623a691bca31142aa99f53b77b9ca5515a4aaacc61d77e2a5bf8a07177c20";
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
var ncmb = new NCMB(applicationkey, clientkey);
|
168
|
-
|
169
|
-
var name;
|
170
|
-
|
171
|
-
var escape;
|
172
|
-
|
173
|
-
var gender;
|
174
|
-
|
175
|
-
var nursing;
|
176
|
-
|
177
|
-
var allergy;
|
178
|
-
|
179
|
-
var address;
|
180
|
-
|
181
|
-
var birthday;
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
function send_to_datastore() {
|
186
|
-
|
187
|
-
var User_intel = ncmb.DataStore("user_intel");
|
188
|
-
|
189
|
-
var user_intel = new User_intel();
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
name = document.querySelector('#name');
|
194
|
-
|
195
|
-
escape = document.querySelector('#escape');
|
196
|
-
|
197
|
-
gender = document.querySelector('#gander');
|
198
|
-
|
199
|
-
nursing = document.querySelector('#nursing');
|
200
|
-
|
201
|
-
allergy = document.querySelector('#allergy');
|
202
|
-
|
203
|
-
var address_tmp0 = document.querySelector('#address0');
|
204
|
-
|
205
|
-
var address_tmp1 = document.querySelector('#address1');
|
206
|
-
|
207
|
-
var address_tmp2 = document.querySelector('#address2');
|
208
|
-
|
209
|
-
var address_tmp3 = document.querySelector('#address3');
|
210
|
-
|
211
|
-
var address_tmp4 = document.querySelector('#address4');
|
212
|
-
|
213
|
-
address = address_tmp0.value + address_tmp1.value + address_tmp2.value + address_tmp3.value + address_tmp4.value;
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
var yyyy = document.querySelector('#yyyy');
|
218
|
-
|
219
|
-
var mmmm = document.querySelector('#mmmm');
|
220
|
-
|
221
|
-
var dddd = document.querySelector('#dddd');
|
222
|
-
|
223
|
-
birthday = yyyy.value + mmmm.value + dddd.value;
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
user_intel.set("name", name.value)
|
228
|
-
|
229
|
-
.set("birthday", birthday)
|
230
|
-
|
231
|
-
.set("escape", escape.value)
|
232
|
-
|
233
|
-
.set("gender", gender.value)
|
234
|
-
|
235
|
-
.set("nursing", nursing.value)
|
236
|
-
|
237
|
-
.set("allergy", allergy.value)
|
238
|
-
|
239
|
-
.set("address", address).save();
|
240
|
-
|
241
|
-
alert("更新成功");
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
}
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
function getUrlVars() {
|
250
|
-
|
251
|
-
var vars = [],
|
252
|
-
|
253
|
-
hash;
|
254
|
-
|
255
|
-
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
256
|
-
|
257
|
-
for (var i = 0; i < hashes.length; i++) {
|
258
|
-
|
259
|
-
hash = hashes[i].split('=');
|
260
|
-
|
261
|
-
vars.push(hash[0]);
|
262
|
-
|
263
|
-
vars[hash[0]] = decodeURIComponent(hash[1]);
|
264
|
-
|
265
|
-
}
|
266
|
-
|
267
|
-
return vars;
|
268
|
-
|
269
|
-
}
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
$(function() {
|
274
|
-
|
275
|
-
// クエリ文字列から値を取得
|
276
|
-
|
277
|
-
var queryString = getUrlVars();
|
278
|
-
|
279
|
-
// 値を設定
|
280
|
-
|
281
|
-
// $('.form-row .name').text(queryString.name);
|
282
|
-
|
283
|
-
// $('.form-row .address').text(queryString.address);
|
284
|
-
|
285
|
-
// $('.form-row .gender').text(queryString.gender);
|
286
|
-
|
287
|
-
// $('.form-row .escape').text(queryString.escape);
|
288
|
-
|
289
|
-
// $('.form-row .nursing').text(queryString.nursing);
|
290
|
-
|
291
|
-
// $('.form-row .allergy').text(queryString.allergy);
|
292
|
-
|
293
|
-
// $('.form-row .birthday').text(queryString.birthday);
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
var qrCodeText2 = [queryString.name, queryString.address, queryString.gender, queryString.escape, queryString.nursing, queryString.allergy, queryString.birthday].join('、');
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
$('.qrcode').qrcode({
|
302
|
-
|
303
|
-
width: 180,
|
304
|
-
|
305
|
-
height: 180,
|
306
|
-
|
307
|
-
text: Encoding.convert(qrCodeText2, 'sjis')
|
308
|
-
|
309
|
-
});
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
});
|
3
コードフォーマットの整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,160 @@
|
|
1
|
+
```var applicationkey = "00d239b7e135bedb216bb35159e5e111a9538adee21f5d5d3e1bbd9ef3d7f82a";
|
2
|
+
|
3
|
+
var clientkey = "d7c623a691bca31142aa99f53b77b9ca5515a4aaacc61d77e2a5bf8a07177c20";
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
var ncmb = new NCMB(applicationkey, clientkey);
|
8
|
+
|
9
|
+
var name;
|
10
|
+
|
11
|
+
var escape;
|
12
|
+
|
13
|
+
var gender;
|
14
|
+
|
15
|
+
var nursing;
|
16
|
+
|
17
|
+
var allergy;
|
18
|
+
|
19
|
+
var address;
|
20
|
+
|
21
|
+
var birthday;
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
function send_to_datastore() {
|
26
|
+
|
27
|
+
var User_intel = ncmb.DataStore("user_intel");
|
28
|
+
|
29
|
+
var user_intel = new User_intel();
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
name = document.querySelector('#name');
|
34
|
+
|
35
|
+
escape = document.querySelector('#escape');
|
36
|
+
|
37
|
+
gender = document.querySelector('#gander');
|
38
|
+
|
39
|
+
nursing = document.querySelector('#nursing');
|
40
|
+
|
41
|
+
allergy = document.querySelector('#allergy');
|
42
|
+
|
43
|
+
var address_tmp0 = document.querySelector('#address0');
|
44
|
+
|
45
|
+
var address_tmp1 = document.querySelector('#address1');
|
46
|
+
|
47
|
+
var address_tmp2 = document.querySelector('#address2');
|
48
|
+
|
49
|
+
var address_tmp3 = document.querySelector('#address3');
|
50
|
+
|
51
|
+
var address_tmp4 = document.querySelector('#address4');
|
52
|
+
|
53
|
+
address = address_tmp0.value + address_tmp1.value + address_tmp2.value + address_tmp3.value + address_tmp4.value;
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
var yyyy = document.querySelector('#yyyy');
|
58
|
+
|
59
|
+
var mmmm = document.querySelector('#mmmm');
|
60
|
+
|
61
|
+
var dddd = document.querySelector('#dddd');
|
62
|
+
|
63
|
+
birthday = yyyy.value + mmmm.value + dddd.value;
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
user_intel.set("name", name.value)
|
68
|
+
|
69
|
+
.set("birthday", birthday)
|
70
|
+
|
71
|
+
.set("escape", escape.value)
|
72
|
+
|
73
|
+
.set("gender", gender.value)
|
74
|
+
|
75
|
+
.set("nursing", nursing.value)
|
76
|
+
|
77
|
+
.set("allergy", allergy.value)
|
78
|
+
|
79
|
+
.set("address", address).save();
|
80
|
+
|
81
|
+
alert("更新成功");
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
function getUrlVars() {
|
90
|
+
|
91
|
+
var vars = [],
|
92
|
+
|
93
|
+
hash;
|
94
|
+
|
95
|
+
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
96
|
+
|
97
|
+
for (var i = 0; i < hashes.length; i++) {
|
98
|
+
|
99
|
+
hash = hashes[i].split('=');bileb
|
100
|
+
|
101
|
+
vars.push(hash[0]);
|
102
|
+
|
103
|
+
vars[hash[0]] = decodeURIComponent(hash[1]);
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
return vars;
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
$(function() {
|
114
|
+
|
115
|
+
// クエリ文字列から値を取得
|
116
|
+
|
117
|
+
var queryString = getUrlVars();
|
118
|
+
|
119
|
+
// 値を設定
|
120
|
+
|
121
|
+
// $('.form-row .name').text(queryString.name);
|
122
|
+
|
123
|
+
// $('.form-row .address').text(queryString.address);
|
124
|
+
|
125
|
+
// $('.form-row .gender').text(queryString.gender);
|
126
|
+
|
127
|
+
// $('.form-row .escape').text(queryString.escape);
|
128
|
+
|
129
|
+
// $('.form-row .nursing').text(queryString.nursing);
|
130
|
+
|
131
|
+
// $('.form-row .allergy').text(queryString.allergy);
|
132
|
+
|
133
|
+
// $('.form-row .birthday').text(queryString.birthday);
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
var qrCodeText2 = [queryString.name, queryString.address, queryString.gender, queryString.escape, queryString.nursing, queryString.allergy, queryString.birthday].join('、');
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
$('.qrcode').qrcode({
|
142
|
+
|
143
|
+
width: 180,
|
144
|
+
|
145
|
+
height: 180,
|
146
|
+
|
147
|
+
text: Encoding.convert(qrCodeText2, 'sjis')
|
148
|
+
|
149
|
+
});
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
});
|
154
|
+
|
155
|
+
コード
|
156
|
+
|
1
|
-
```HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
157
|
+
``````HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
2
158
|
|
3
159
|
```JavaScript
|
4
160
|
|
2
コードフォーマットの整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
```HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
2
2
|
|
3
3
|
```JavaScript
|
4
|
-
|
5
|
-
コード
|
6
4
|
|
7
5
|
```var applicationkey = "00d239b7e135bedb216bb35159e5e111a9538adee21f5d5d3e1bbd9ef3d7f82a";
|
8
6
|
|
1
コードフォーマットの整理
test
CHANGED
File without changes
|
test
CHANGED
@@ -1 +1,159 @@
|
|
1
|
-
HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
1
|
+
```HTMLで作成した入力フォームのテキストデータをQRコード化して表示するプログラムをjavascriptで作っていいるのですが、QRコード内にテキストデータが入りません。原因をどなたか教えてください。
|
2
|
+
|
3
|
+
```JavaScript
|
4
|
+
|
5
|
+
コード
|
6
|
+
|
7
|
+
```var applicationkey = "00d239b7e135bedb216bb35159e5e111a9538adee21f5d5d3e1bbd9ef3d7f82a";
|
8
|
+
|
9
|
+
var clientkey = "d7c623a691bca31142aa99f53b77b9ca5515a4aaacc61d77e2a5bf8a07177c20";
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
var ncmb = new NCMB(applicationkey, clientkey);
|
14
|
+
|
15
|
+
var name;
|
16
|
+
|
17
|
+
var escape;
|
18
|
+
|
19
|
+
var gender;
|
20
|
+
|
21
|
+
var nursing;
|
22
|
+
|
23
|
+
var allergy;
|
24
|
+
|
25
|
+
var address;
|
26
|
+
|
27
|
+
var birthday;
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
function send_to_datastore() {
|
32
|
+
|
33
|
+
var User_intel = ncmb.DataStore("user_intel");
|
34
|
+
|
35
|
+
var user_intel = new User_intel();
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
name = document.querySelector('#name');
|
40
|
+
|
41
|
+
escape = document.querySelector('#escape');
|
42
|
+
|
43
|
+
gender = document.querySelector('#gander');
|
44
|
+
|
45
|
+
nursing = document.querySelector('#nursing');
|
46
|
+
|
47
|
+
allergy = document.querySelector('#allergy');
|
48
|
+
|
49
|
+
var address_tmp0 = document.querySelector('#address0');
|
50
|
+
|
51
|
+
var address_tmp1 = document.querySelector('#address1');
|
52
|
+
|
53
|
+
var address_tmp2 = document.querySelector('#address2');
|
54
|
+
|
55
|
+
var address_tmp3 = document.querySelector('#address3');
|
56
|
+
|
57
|
+
var address_tmp4 = document.querySelector('#address4');
|
58
|
+
|
59
|
+
address = address_tmp0.value + address_tmp1.value + address_tmp2.value + address_tmp3.value + address_tmp4.value;
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
var yyyy = document.querySelector('#yyyy');
|
64
|
+
|
65
|
+
var mmmm = document.querySelector('#mmmm');
|
66
|
+
|
67
|
+
var dddd = document.querySelector('#dddd');
|
68
|
+
|
69
|
+
birthday = yyyy.value + mmmm.value + dddd.value;
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
user_intel.set("name", name.value)
|
74
|
+
|
75
|
+
.set("birthday", birthday)
|
76
|
+
|
77
|
+
.set("escape", escape.value)
|
78
|
+
|
79
|
+
.set("gender", gender.value)
|
80
|
+
|
81
|
+
.set("nursing", nursing.value)
|
82
|
+
|
83
|
+
.set("allergy", allergy.value)
|
84
|
+
|
85
|
+
.set("address", address).save();
|
86
|
+
|
87
|
+
alert("更新成功");
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
function getUrlVars() {
|
96
|
+
|
97
|
+
var vars = [],
|
98
|
+
|
99
|
+
hash;
|
100
|
+
|
101
|
+
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
102
|
+
|
103
|
+
for (var i = 0; i < hashes.length; i++) {
|
104
|
+
|
105
|
+
hash = hashes[i].split('=');
|
106
|
+
|
107
|
+
vars.push(hash[0]);
|
108
|
+
|
109
|
+
vars[hash[0]] = decodeURIComponent(hash[1]);
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
return vars;
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
$(function() {
|
120
|
+
|
121
|
+
// クエリ文字列から値を取得
|
122
|
+
|
123
|
+
var queryString = getUrlVars();
|
124
|
+
|
125
|
+
// 値を設定
|
126
|
+
|
127
|
+
// $('.form-row .name').text(queryString.name);
|
128
|
+
|
129
|
+
// $('.form-row .address').text(queryString.address);
|
130
|
+
|
131
|
+
// $('.form-row .gender').text(queryString.gender);
|
132
|
+
|
133
|
+
// $('.form-row .escape').text(queryString.escape);
|
134
|
+
|
135
|
+
// $('.form-row .nursing').text(queryString.nursing);
|
136
|
+
|
137
|
+
// $('.form-row .allergy').text(queryString.allergy);
|
138
|
+
|
139
|
+
// $('.form-row .birthday').text(queryString.birthday);
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
var qrCodeText2 = [queryString.name, queryString.address, queryString.gender, queryString.escape, queryString.nursing, queryString.allergy, queryString.birthday].join('、');
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
$('.qrcode').qrcode({
|
148
|
+
|
149
|
+
width: 180,
|
150
|
+
|
151
|
+
height: 180,
|
152
|
+
|
153
|
+
text: Encoding.convert(qrCodeText2, 'sjis')
|
154
|
+
|
155
|
+
});
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
});
|