質問するログイン新規登録

質問編集履歴

2

改善

2016/09/06 02:36

投稿

a-_.
a-_.

スコア133

title CHANGED
File without changes
body CHANGED
File without changes

1

改善

2016/09/06 02:36

投稿

a-_.
a-_.

スコア133

title CHANGED
File without changes
body CHANGED
@@ -1,2 +1,112 @@
1
1
  開発ツールのコンソールについてなんですが、console.logで出力しようと思いコーディングして開発ツールで見ようと思っても何も表示されない現象が発生してるんです
2
- 原因として何が挙げられるんでしょうか
2
+ 原因として何が挙げられるんでしょうか
3
+
4
+ すいません
5
+ 具体的な内容がありませんでしたね
6
+ 下記コードの各「console」で処理している箇所が現在確認したい内容です
7
+ ブラウザはIE11で、操作の手順としては開発ツールのコンソールタグを選択しても何も表示されない状況です
8
+ 細かい設定等はいじっていません
9
+ 因みに他のブラウザでは試していません
10
+ ```HTML
11
+ <html>
12
+ <head>
13
+ <meta charset="utf-8">
14
+ <script>
15
+ function condition() {
16
+ var ps = document.getElementById("r1");
17
+ var up = document.getElementById("r2");
18
+ var de = document.getElementById("r3");
19
+ if (ps.checked == true || up.checked == true) {
20
+ if (document.getElementById('name').value.length >= 10) {
21
+ window.alert("ERROR1");
22
+ return false;
23
+ } else if (document.getElementById('name').value.length == "") {
24
+ window.alert("ERROR2");
25
+ return false;
26
+ } else if (document.getElementById('comment').value.length >= 300) {
27
+ window.alert("ERROR3");
28
+ return false;
29
+ } else if (document.getElementById('comment').value.length == "") {
30
+ window.alert("ERROR4");
31
+ return false;
32
+ }
33
+ }
34
+ if (up.checked == true || de.checked == true) {
35
+ cde = document.getElementsByName('chkid[]');
36
+ for(var bde = 0; bde < cde.length; bde++) {
37
+ console.log(cde[bde]);
38
+ console.log(bde);
39
+ cde[bde].disabled = false;
40
+ }
41
+ if (cde == 0) {
42
+ window.alert ("ERROR5");
43
+ }
44
+ }
45
+ }
46
+ function change(obj) {
47
+ console.log(obj.id);
48
+ if (obj.id == "r1") {
49
+ document.getElementById("send").value = "投稿";
50
+ chkchange(true);
51
+ } else if (obj.id == "r2") {
52
+ document.getElementById("send").value = "更新";
53
+ chkchange(false);
54
+ } else if (obj.id == "r3") {
55
+ document.getElementById("send").value = "削除";
56
+ chkchange(false);
57
+ }
58
+ }
59
+ function chkchange(bool) {
60
+ chk = document.getElementsByName('chkid[]');
61
+ for(var box = 0; box < chk.length; box++) {
62
+ console.log(chk[box]);
63
+ console.log(box);
64
+ chk[box].disabled = bool;
65
+ }
66
+ }
67
+ </script>
68
+ </head>
69
+ <body>
70
+ <form method="post" action="" onsubmit="return condition()">
71
+ <table>
72
+ <tr>
73
+ <td>
74
+ 名前:<input type="text" name="name" id="name">
75
+ 内容:<textarea name="comment" cols="30" rows="3" id="comment"></textarea>
76
+ <input type="radio" name="bbs" id="r1" value="post" onchange="change(this)">投稿
77
+ <input type="radio" name="bbs" id="r2" value="update" onchange="change(this)">更新
78
+ <input type="radio" name="bbs" id="r3" value="delete" onchange="change(this)">削除
79
+ <input type="submit" value="投稿" id="send">
80
+ </td>
81
+ </tr>
82
+ </table>
83
+
84
+ <?php
85
+ while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
86
+ ?>
87
+
88
+ <table>
89
+ <input type="checkbox" name="chkid[]" value="<?=$row['id'] ?>">
90
+ <tr>
91
+ <td>名前:
92
+ <?php echo $row['name'] ?>
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td>内容:
97
+ <?php echo $row['comment'] ?>
98
+ </td>
99
+ </tr>
100
+ </table>
101
+
102
+ <?php
103
+ }
104
+ mysqli_free_result($result);
105
+
106
+ mysqli_close($link);
107
+ ?>
108
+
109
+ </form>
110
+ </body>
111
+ </html>
112
+ ```