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

回答編集履歴

2

<input type="image"> の load イベントを追記

2016/12/19 00:20

投稿

think49
think49

スコア18194

answer CHANGED
@@ -5,8 +5,15 @@
5
5
  - [4.10.5 input要素 - HTML Standard 日本語訳](https://momdo.github.io/html/forms.html#the-input-element)
6
6
  - [4.10.5 The input element - HTML Standard](https://html.spec.whatwg.org/multipage/forms.html#the-input-element)
7
7
 
8
- 他の要素も同様なので、必要になった時に仕様書から逆引きすればいいと思います。
8
+ ただし、**<input type="image"> だけは load イベントが発生する**ようす(日本語訳には自信がので誤りがあれば訂正のコメントを頂ければ有難)
9
9
 
10
+ > The task that is queued by the networking task source once the resource has been fetched, must, if the download was successful and the image is available, queue a task to fire an event named load at the input element
11
+ > https://html.spec.whatwg.org/multipage/forms.html#image-button-state-(type=image)
12
+
13
+ (Google翻訳) リソースがフェッチされた後にネットワークタスクソースによってキューに入れられるタスクは、ダウンロードが成功してイメージが利用可能な場合、入力要素でloadという名前のイベントを発生させるタスクをキューに入れます。
14
+
15
+ ※他の要素も同様の手順で調査可能なので、必要になった時に仕様書から逆引きすればいいと思います。
16
+
10
17
  ### load イベント
11
18
 
12
19
  UI Events によれば、load イベントはリソースを読み込むときに発火しなければならない、とあります。
@@ -16,4 +23,8 @@
16
23
 
17
24
  input要素では読み込むべきリソースが存在しない為、onload 属性が存在しないのでしょう。
18
25
 
26
+ ### 更新履歴
27
+
28
+ - 2016/12/19 09:20 <input type="image"> の load イベントを追記
29
+
19
30
  Re: TOKKIYNET さん

1

markdown修正

2016/12/19 00:20

投稿

think49
think49

スコア18194

answer CHANGED
@@ -1,13 +1,19 @@
1
1
  ### onload 属性
2
2
 
3
3
  「input要素がonload属性を持っているか」はHTMLの仕様書を読めば分かります。下記URLによればonload属性は存在しません。
4
+
4
- https://momdo.github.io/html/forms.html#the-input-element
5
+ - [4.10.5 input要素 - HTML Standard 日本語訳](https://momdo.github.io/html/forms.html#the-input-element)
6
+ - [4.10.5 The input element - HTML Standard](https://html.spec.whatwg.org/multipage/forms.html#the-input-element)
7
+
5
8
  他の要素でも同様なので、必要になった時に仕様書から逆引きすればいいと思います。
6
9
 
7
10
  ### load イベント
8
11
 
9
12
  UI Events によれば、load イベントはリソースを読み込むときに発火しなければならない、とあります。
13
+
10
- https://triple-underscore.github.io/uievents-ja.html#event-type-load
14
+ - [4.1.2.1. load - UI Events (日本語訳)](https://triple-underscore.github.io/uievents-ja.html#event-type-load)
15
+ - [4.1.2.1. load - UI Events](https://www.w3.org/TR/uievents/#event-type-load)
16
+
11
17
  input要素では読み込むべきリソースが存在しない為、onload 属性が存在しないのでしょう。
12
18
 
13
19
  Re: TOKKIYNET さん