onerror事件
Definition and Usage
定義與用法
The onerror event is triggered when an error occurs loading a document or an p_w_picpath.當(dāng)加載過程中產(chǎn)生錯誤時觸發(fā)onerror事件
Syntax
語法
| οnerrοr="所要執(zhí)行的腳本" |
| SomeJavaScriptCode 所要執(zhí)行的腳本 | Required. Specifies a JavaScript to be executed when the event occurs. 必選項。當(dāng)事件觸發(fā)時所要執(zhí)行的腳本 |
所支持的HTML標(biāo)簽:
| <img>, <object>, <style> |
| window, p_w_picpath |
Example
實例
In this example an alert box will be displayed if an error occurs when loading an p_w_picpath:在下面的例子中,當(dāng)加載圖片錯誤時將彈出一個消息框:
| <img src="p_w_picpath.gif" οnerrοr="alert('The p_w_picpath could not be loaded.')"> |
轉(zhuǎn)載于:https://blog.51cto.com/chensanxin/82017
總結(jié)
- 上一篇: IIS中WEB服务器的日志存放到SQL
- 下一篇: 简单的分页控件