質問編集履歴

2

内容の編集

2021/04/23 06:19

投稿

python_k
python_k

スコア7

test CHANGED
File without changes
test CHANGED
@@ -13,123 +13,3 @@
13
13
 
14
14
 
15
15
  よろしくお願いします。
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
- ```
24
-
25
- test.html
26
-
27
- <html lang="ja">
28
-
29
- <head>
30
-
31
- <meta charset="utf-8">
32
-
33
- <meta name="description"content="test">
34
-
35
- <meta name="viewport"content="width=device-width,height=device-height,initial-scale=1.0,minimum-scale=1.0">
36
-
37
- <title>test</title>
38
-
39
- <link rel="stylesheet" href="test.css">
40
-
41
- <script type="text/javascript" src="test.js"></script>
42
-
43
- </head>
44
-
45
- <body onload="create()">
46
-
47
- <article>
48
-
49
- <section>
50
-
51
- <div>
52
-
53
- <input type="datetime-local" id="calendar" name="date" step="60">
54
-
55
- <script type="text/javascript"src="test2.js"></script>
56
-
57
- </div>
58
-
59
- </section>
60
-
61
- </article>
62
-
63
- </body>
64
-
65
- </html>
66
-
67
- ```
68
-
69
-
70
-
71
- ```
72
-
73
- test.js
74
-
75
- var create=function(){
76
-
77
- var testdate="2021-04-16-16-26"
78
-
79
- var iframe=document.createElement("iframe");
80
-
81
- document.body.appendChild(iframe);
82
-
83
- iframe.src="data/"+testdate+".html" ;
84
-
85
- iframe.id="htmlframe";
86
-
87
- iframe.name="viewhtml";
88
-
89
- iframe.width="3000";
90
-
91
- iframe.height="600";
92
-
93
- document.getElementById("calendar").value="2021-04-16T16:26"
94
-
95
- }
96
-
97
- ```
98
-
99
-
100
-
101
- ```
102
-
103
- test2.js
104
-
105
- calendar.oninput=function inputChange(){
106
-
107
- console.log(document.getElementById("calendar").value);
108
-
109
-
110
-
111
- var path=document.getElementById('calendar').value;
112
-
113
- path=path.replace('T','-');
114
-
115
- path=path.replace(':','-');
116
-
117
-
118
-
119
- var path="data/"+path+".html"
120
-
121
- try{
122
-
123
- document.getElementById("htmlframe").contentWindow.location.replace(path);
124
-
125
-
126
-
127
- }catch(e){
128
-
129
- alert("ファイルが存在しません");
130
-
131
- }
132
-
133
- };
134
-
135
- ```

1

コードを追加しました

2021/04/23 06:19

投稿

python_k
python_k

スコア7

test CHANGED
File without changes
test CHANGED
@@ -13,3 +13,123 @@
13
13
 
14
14
 
15
15
  よろしくお願いします。
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+ ```
24
+
25
+ test.html
26
+
27
+ <html lang="ja">
28
+
29
+ <head>
30
+
31
+ <meta charset="utf-8">
32
+
33
+ <meta name="description"content="test">
34
+
35
+ <meta name="viewport"content="width=device-width,height=device-height,initial-scale=1.0,minimum-scale=1.0">
36
+
37
+ <title>test</title>
38
+
39
+ <link rel="stylesheet" href="test.css">
40
+
41
+ <script type="text/javascript" src="test.js"></script>
42
+
43
+ </head>
44
+
45
+ <body onload="create()">
46
+
47
+ <article>
48
+
49
+ <section>
50
+
51
+ <div>
52
+
53
+ <input type="datetime-local" id="calendar" name="date" step="60">
54
+
55
+ <script type="text/javascript"src="test2.js"></script>
56
+
57
+ </div>
58
+
59
+ </section>
60
+
61
+ </article>
62
+
63
+ </body>
64
+
65
+ </html>
66
+
67
+ ```
68
+
69
+
70
+
71
+ ```
72
+
73
+ test.js
74
+
75
+ var create=function(){
76
+
77
+ var testdate="2021-04-16-16-26"
78
+
79
+ var iframe=document.createElement("iframe");
80
+
81
+ document.body.appendChild(iframe);
82
+
83
+ iframe.src="data/"+testdate+".html" ;
84
+
85
+ iframe.id="htmlframe";
86
+
87
+ iframe.name="viewhtml";
88
+
89
+ iframe.width="3000";
90
+
91
+ iframe.height="600";
92
+
93
+ document.getElementById("calendar").value="2021-04-16T16:26"
94
+
95
+ }
96
+
97
+ ```
98
+
99
+
100
+
101
+ ```
102
+
103
+ test2.js
104
+
105
+ calendar.oninput=function inputChange(){
106
+
107
+ console.log(document.getElementById("calendar").value);
108
+
109
+
110
+
111
+ var path=document.getElementById('calendar').value;
112
+
113
+ path=path.replace('T','-');
114
+
115
+ path=path.replace(':','-');
116
+
117
+
118
+
119
+ var path="data/"+path+".html"
120
+
121
+ try{
122
+
123
+ document.getElementById("htmlframe").contentWindow.location.replace(path);
124
+
125
+
126
+
127
+ }catch(e){
128
+
129
+ alert("ファイルが存在しません");
130
+
131
+ }
132
+
133
+ };
134
+
135
+ ```