|
|
|
Undefined property
|
|||
|---|---|---|---|
|
#18+
Есть такой класс: Код: java 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. создаю экземпляр: Код: java 1. 2. и мне выдает ошибку: автор[12.11.2012 15:15:34] Uncaught exception: TypeError: Cannot convert '$this.eventList' to object Error thrown at line 112, column 8 in <anonymous function: fire>(event) in ......: for (var i=0;i < $this.eventList[event].length; $this++) called from line 86, column 16 in <anonymous function: tick>() in .....: $this.fire('play'); в чем может быть проблема? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.11.2012, 15:26:43 |
|
||
|
Undefined property
|
|||
|---|---|---|---|
|
#18+
чуток даж не так вызываю а так: Код: java 1. 2. 3. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.11.2012, 15:29:29 |
|
||
|
Undefined property
|
|||
|---|---|---|---|
|
#18+
Вылазит всего 1 раз alert() и после этого начиаеться эта ошибка, что делать? код для копипаста<script type="text/javascript"> function PlayerTimer() { var $this = this; this.eventList = {wait:[], play:[]}; this.timer = null; this.interval = 500; this.init = function() { this.timer = window.setInterval(this.tick, this.interval); } this.observe = function(event, func) { this.eventList[event].push(func); } this.fire = function (event) { for (var i = 0; i < $this.eventList[event].length; $this++) { if (!$this.stoped) { $this.eventList[event][i]($this); } } } this.tick = function() { $this.fire('play'); } this.init(); } window.playerTimer = new PlayerTimer(); window.playerTimer.observe('play', function() {alert('ok');}); </script> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 12.11.2012, 15:31:32 |
|
||
|
|

start [/forum/topic.php?fid=22&tid=1449125]: |
0ms |
get settings: |
9ms |
get forum list: |
9ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
184ms |
get topic data: |
7ms |
get forum data: |
2ms |
get page messages: |
26ms |
get tp. blocked users: |
1ms |
| others: | 243ms |
| total: | 485ms |

| 0 / 0 |
