question about $get in ajax scriptAction

  • Thread starter Thread starter Luc
  • Start date Start date
L

Luc

Hi,

i'm learning ajax and i found this code in one of the sample (aspx) files:

<ScriptAction Script="Cover($get('flyout'), $get('info'));" />

'Cover' is a javascript function, but what is '$get'? Is this the same as
document.getElementById ? If yes, which advantage has it?

Thanks
Luc
 
Luc said:
Hi,

i'm learning ajax and i found this code in one of the sample (aspx)
files:

<ScriptAction Script="Cover($get('flyout'), $get('info'));" />

'Cover' is a javascript function, but what is '$get'? Is this the same as
document.getElementById ? If yes, which advantage has it?

Thanks
Luc

It is a special function reference in the Microsoft AJAX Scripting Library
and yes, it is the same as document.getElementById().

There is no advantage, per se, to using it, other than it's a lot easier to
type than document.getElementById().

The whole point of the AJAX Scripting Library is that it exposes
functionality that would take the developer a lot longer to write if they
had to write it by hand. You'll find that the library mimics the server
side .NET Framework in many ways, offering (among other things) similar
namespaces and object properties and methods that don't exisit natively in
JavaScript.

-Scott
 
Thanks
Scott M. said:
It is a special function reference in the Microsoft AJAX Scripting Library
and yes, it is the same as document.getElementById().

There is no advantage, per se, to using it, other than it's a lot easier
to type than document.getElementById().

The whole point of the AJAX Scripting Library is that it exposes
functionality that would take the developer a lot longer to write if they
had to write it by hand. You'll find that the library mimics the server
side .NET Framework in many ways, offering (among other things) similar
namespaces and object properties and methods that don't exisit natively in
JavaScript.

-Scott
 
Back
Top