在微软的Ajax,究竟是什么$找到吗?微软、Ajax

2023-09-10 19:22:25 作者:~落寞_de笑

我很困惑,什么微软的Ajax $发现居然是。 它只是返回的控制以类似的方式,从jQuery的或JavaScript自己的getElementById的$运营商怎么办?

I'm so confused as to what $find from Microsoft Ajax actually is. Does it just return a control in a similar manner that the $ operator from jquery or javascript's own getElementById do?

如果我这样做

$find('someControlId')

我会得到相同的对象返回从jQuery的

Will I get the same object back from jquery's

$('#someControlId')

或JavaScript

or Javascript

getElementById('someControlId')

我想问的原因是因为当我使用$找到一些Telerik控制的客户端ID,返回的对象似乎有一种类型。

The reason I ask is because when I use $find on the ClientId of some Telerik controls, the object returned seems to have a type.

原来是车轮的这只是一个例子被改造或它实际上做点别的?

So is this just another instance of the wheel being reinvented or does it actually do something else?

推荐答案

我是能够的查找的通过快速谷歌搜索的以下信息:

I was able to find the following information via a quick Google search:

为什么要选择$找到,而不是$得到什么呢?在$ get函数   是简写的document.getElementById。因此,它只能看   为DOM元素。在$查找功能代表Sys.Application.findComponent   和适用于Microsoft AJAX库的任何组件,它一直   以编程方式创建。

Why should you opt for $find instead of $get? The $get function is shorthand for document.getElementById. As such, it can only look for DOM elements. The $find function stands for Sys.Application.findComponent and applies to any component of the Microsoft AJAX Library that has been programmatically created.

从MSDN:http://msdn.microsoft.com/en-us/magazine/cc135984.aspx

有关进一步阅读,看 Sys.Applicationl.findComponent多科。