| 1 |
wakaba |
1.1 |
<html xmlns="http://www.w3.org/1999/xhtml" |
| 2 |
|
|
xmlns:ev="http://www.w3.org/2001/xml-events" |
| 3 |
|
|
xml:lang="en"> |
| 4 |
|
|
<head> |
| 5 |
|
|
<title>observer ~ <script ev:observer=""></title> |
| 6 |
|
|
</head> |
| 7 |
|
|
<body> |
| 8 |
|
|
<h1><var>observer</var> ~ <code><script ev:observer=""></code></h1> |
| 9 |
|
|
|
| 10 |
|
|
<p>Is a <code><script ev:event="" ev:observer=""></code> |
| 11 |
|
|
executed during loading the document? |
| 12 |
|
|
<em id="executed">FAIL</em></p> |
| 13 |
|
|
|
| 14 |
|
|
<p>Is a <code><script ev:event="" ev:observer=""></code> |
| 15 |
|
|
executed when <button id="button">an event is dispatched</button>? |
| 16 |
|
|
<em id="invoked">not yet</em></p> |
| 17 |
|
|
|
| 18 |
|
|
<script type="text/javascript"> |
| 19 |
|
|
window.Loading = true; |
| 20 |
|
|
document.getElementById ('executed').textContent = 'No'; |
| 21 |
|
|
</script> |
| 22 |
|
|
|
| 23 |
|
|
<script type="text/javascript" ev:event="click" ev:observer="button"> |
| 24 |
|
|
if (window.Loading) { |
| 25 |
|
|
document.getElementById ('executed').textContent = 'Yes'; |
| 26 |
|
|
} else { |
| 27 |
|
|
document.getElementById ('invoked').textContent = 'PASS'; |
| 28 |
|
|
} |
| 29 |
|
|
</script> |
| 30 |
|
|
|
| 31 |
|
|
<script type="text/javascript"> |
| 32 |
|
|
window.Loading = false; |
| 33 |
|
|
</script> |
| 34 |
|
|
|
| 35 |
|
|
</body> |
| 36 |
|
|
</html> |