| 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><script ev:observer=""> ~ observer</title> |
| 6 |
</head> |
| 7 |
<body> |
| 8 |
<h1><code><script ev:observer=""></code> ~ <var>observer</var></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 |
<script type="text/javascript"> |
| 15 |
window.Loading = true; |
| 16 |
document.getElementById ('executed').textContent = 'No'; |
| 17 |
</script> |
| 18 |
|
| 19 |
<script type="text/javascript" ev:event="click" ev:observer="button"> |
| 20 |
if (window.Loading) { |
| 21 |
document.getElementById ('executed').textContent = 'Yes'; |
| 22 |
} else { |
| 23 |
document.getElementById ('invoked').textContent = 'PASS'; |
| 24 |
} |
| 25 |
</script> |
| 26 |
|
| 27 |
<script type="text/javascript"> |
| 28 |
window.Loading = false; |
| 29 |
</script> |
| 30 |
|
| 31 |
<p>Is a <code><script ev:event="" ev:observer=""></code> |
| 32 |
executed when <button id="button">an event is dispatched</button>? |
| 33 |
<em id="invoked">not yet</em></p> |
| 34 |
|
| 35 |
</body> |
| 36 |
</html> |