prototype.js bindAsEventListener没有'this' [英] prototype.js bindAsEventListener without 'this'

查看:80
本文介绍了prototype.js bindAsEventListener没有'this'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个对象之外设置一个事件观察者,所以我

不能使用this.bindAsEventListener。我怎样才能传递正确的物品

参考?


我尝试了类似这样的东西,以及其他各种变化,但没有运气。

当我从对象内部设置它时,使用this。,


Event.observe(targetId,'click'',targetId.select。 bin dAsEventListener(this),false);

解决方案

Diodeus于2006年6月5日下午4:45发表以下声明:< blockquote class =post_quotes>我想在一个对象之外设置一个事件观察者,所以我不能使用this.bindAsEventListener。我怎样才能传递正确的对象
参考?




你指的是什么?不要假设主题行可以,或者

甚至是,读取。


尝试向作者询问有关代码的那个废话称为prototype.js 。


-

兰迪

comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周

Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /




是的,也许他糟糕的回复会比你的null更有帮助

内容一。


Randy Webb写道:

Diodeus在2006年6月5日下午4:45说:

我想在一个对象之外设置一个事件观察者,所以我不能使用this.bindAsEventListener。我怎样才能传递正确的对象
参考?



你指的是什么?不要认为主题行可以是,或者甚至是阅读。

尝试向作者询问关于代码的那个废话称为prototype.js。
-
Randy
comp.lang.javascript常见问题 - http:// jibbering .com / faq &新闻组每周
Javascript最佳实践 - http://www.JavascriptToolbox.com/bestpractices /




Diodeus于2006年6月5日下午7:07说:

是的,也许他糟糕的回复会比你的内容更有帮助。




见?你今天学到了新东西。


你使用白痴编写的代码,然后你想要这个小组中的某个人

来浏览所有写的代码白痴告诉你如何将b $ b扩展为由白痴写的代码然后不喜欢它们

告诉你问作者写的代码是什么白痴?


PS我是否提到prototype.js是由白痴写的代码?


这是Usenet,而不是你的服务台。


-

Randy

comp.lang.javascript常见问题 - http ://jibbering.com/faq &新闻组每周

Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /


I would like to set up an event observer outside of an object, so I
can''t use this.bindAsEventListener. How can I pass the correct object
reference?

I tried something like this, and various other variations, but no luck.
This works when I set it up from inside the object, using "this.",

Event.observe(targetId,''click'',targetId.select.bin dAsEventListener(this),false);

解决方案

Diodeus said the following on 6/5/2006 4:45 PM:

I would like to set up an event observer outside of an object, so I
can''t use this.bindAsEventListener. How can I pass the correct object
reference?



What are you referring to? Do not assume the subject line can be, or
even is, read.

Try asking the author of that crap known as prototype.js about the code.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/



Yeah, maybe his crappy reply will be more helpful than your null
content one.

Randy Webb wrote:

Diodeus said the following on 6/5/2006 4:45 PM:

I would like to set up an event observer outside of an object, so I
can''t use this.bindAsEventListener. How can I pass the correct object
reference?



What are you referring to? Do not assume the subject line can be, or
even is, read.

Try asking the author of that crap known as prototype.js about the code.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/




Diodeus said the following on 6/5/2006 7:07 PM:

Yeah, maybe his crappy reply will be more helpful than your null
content one.



See? You learned something new today.

You use code written by an idiot and then you want someone in this group
to wade through all that code written by an idiot to tell you how to
extend that code written by an idiot and then don''t like it when they
tell you to ask the author of that code written by an idiot?

P.S. Did I mention that prototype.js is code written by an idiot?

This is Usenet, not your help desk.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


这篇关于prototype.js bindAsEventListener没有'this'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆