question about $get in ajax scriptAction

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
 
S

Scott M.

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
 
L

Luc

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,099
Messages
2,570,626
Members
47,237
Latest member
David123

Latest Threads

Top