views:

45

answers:

3

What is the difference between the $get and $find functions in javascript?

I'm guessing that these functions aren't really javascript-native things, so an additional question would be what are they native to?

Clarification

The web app I've seen this in uses jquery and ASP.NET AJAX. Perhaps that changes the meaning of these functions?

A: 

$get and $find are not part of Javascript. They are either a part of your Javascript host, in any library or code you have or undefined. If they are undefined then there is no difference.

svinto
A: 

They look like jQuery function (jQuery is a libraru that wraps a lot of javascript making it cross platform with a lot of extended features):

$.get is an Http Get (http://api.jquery.com/jQuery.get/)

$.find is used to find decendent html elements (http://api.jquery.com/find/)

Mark Redman
+4  A: 

You are talking about the MS Ajax Client Library shortcut methods.

$find is a shortcut for the Sys.Application.findComponent method, and allows you to get a Component object.

$get is a shortcut for the Sys.UI.DomElement getElementById method, and it returns a DomElement object.

Check the following article:

CMS