diff options
Diffstat (limited to 'files/ja/web/api/networkinformation/onchange/index.html')
| -rw-r--r-- | files/ja/web/api/networkinformation/onchange/index.html | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/files/ja/web/api/networkinformation/onchange/index.html b/files/ja/web/api/networkinformation/onchange/index.html new file mode 100644 index 0000000000..e29f1d538c --- /dev/null +++ b/files/ja/web/api/networkinformation/onchange/index.html @@ -0,0 +1,110 @@ +--- +title: NetworkInformation.onchange +slug: Web/API/NetworkInformation/onchange +tags: + - API + - Event Handler + - Experimental + - Network Information API + - NetworkInformation + - Property + - Reference +translation_of: Web/API/NetworkInformation/onchange +--- +<p>{{apiref("Network Information API")}}{{SeeCompatTable}}</p> + +<p><strong><code>NetworkInformation.onchange</code></strong> イベントハンドラは、接続情報が変化したときに発火し、{{domxref("NetworkInformation")}} オブジェクトが {{event("change")}} を受け取るコードを含みます。</p> + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox"><em>netInfo</em>.onchange = function() { ... } +</pre> + +<h2 id="例">例</h2> + +<pre class="brush: js">// 接続型の取得 +var type = navigator.connection.type; + +function changeHandler(e) { + // ここで接続型の変更を操作する +} + +// change イベントの登録: +navigator.connection.onchange = changeHandler; + +// Another way: navigator.connection.addEventListener('change', changeHandler);</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Network Information')}}</td> + <td>{{Spec2('Network Information')}}</td> + <td>最初の定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザ実装状況">ブラウザ実装状況</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatChrome(47)}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Android</th> + <th>Android Webview</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + <th>Chrome for Android</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}} [1]</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Firefox では、イベントハンドラで送信される <code>typechange</code> イベントは、<code>ontypechange</code> です。</p> |
