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