views:

546

answers:

3

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.

+1  A: 

$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/

redsquare
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
http://www.asp.net/ajax/documentation/
redsquare
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. <http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx>
Robert Paulson
Depricated as far as I am concerned, and good riddance
redsquare
+1  A: 

$() 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 :-)

Filini
+2  A: 

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.

JamesEggers