1

It doesn't look like basic javascript but nor can I use JQuery commands like $('myId'). Is this or similar functions documented anywhere?

For reason I don't want to go into, I am not able to use 3rd party libraries like JQuery but if some powerful javascript extensions come with asp then I would like to know about them.

4 Answers 4

4

$get is a function from the (now depreciated) ms ajax core javascript library. In the future they will be using jquery therefore $get will just be $('#myid') so I dont understand your feelings about not using jQuery, MS have decided to embrace OpenSource and bundle it with visual studio, check out Scott Gu and Hanslemans announcements on their blogs.

The ms ajax $get('foo') and jQuery $('#someID') are both just shortened wrappers around native javascript document.getElementById('bla')

ms ajax docs http://www.asp.net/ajax/documentation/

2
  • I would like to use JQuery but I can't, I have to stick with what I have. Is 'ms ajax core javascript library' documented anywhere?
    – tpower
    Oct 16, 2008 at 8:42
  • Depricated? MS Ajax core isn't depricated from everything I've read. The announcement is that MS is going to ship and support JQuery in future versions of Visual Studio and will also support it on their platform. <weblogs.asp.net/scottgu/archive/2008/09/28/…> Oct 16, 2008 at 9:53
2

Something to keep in mind is that MS AJAX's $get() function returns the same things as document.getElementById() where as JQuery's $() function returns a special object with different properties and methods. While they are used to select elements in the DOM, the $() is a lot more powerful thanks to jQuery's framework and the vast array of Plug-Ins available for it.

As far as adoption and such, both Visual Studio 2008 and Adobe's Dreamweaver CS4 (I think CS3 as well) have the ability to have jQuery integrated. While you're forbidden to use 3rd party libraries, I'd hope that you'd be able to make a case that reinventing the wheel or the plumbing code that someone else has already done can be very costly...especially if the 3rd party libraries are free.

1

$() and $get() are simply functions which return a collection of objects and a lot of methods to call on them.

You can define your own $:


function $()
{
    alert('foo');
} 

$();

will alert "foo".

As redsquare pointed out, jQuery will be shipped with Visual Studio soon, so you can sell to your management (which is, I think, the only reason you're forbidden to use it) that it's not "third-party" any more :-)

0

check out this one. http://msdn.microsoft.com/en-us/library/cc165447(v=vs.100).aspx There are altogether 7 shortcuts methods they are $addHandler, $addHandlers, $clearHandlers, $create, $find, $get and $removeHandler

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.