最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ASP.Net AJAX uses syntax like $get('myId'), is this standard Javascript or JQuery? - Stack Overflow

programmeradmin0浏览0评论

It doesn't look like basic javascript but nor can I use JQuery mands 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 e with asp then I would like to know about them.

It doesn't look like basic javascript but nor can I use JQuery mands 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 e with asp then I would like to know about them.

Share Improve this question edited Nov 3, 2008 at 16:46 DevelopingChris 40.9k30 gold badges89 silver badges119 bronze badges asked Oct 16, 2008 at 8:36 tpowertpower 56.9k19 gold badges70 silver badges101 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 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/ajax/documentation/

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.

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

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

发布评论

评论列表(0)

  1. 暂无评论