The following points hope to help you speed up your learning.
1. Use selectors as the sets in Asp.net.
In the Asp.net world, it is rare to find a series of controls through a query. On the contrary, we are used to finding a control through a unique ID. Of course, there is no problem in jquery, but jquery's selection function is more amazing.
Using jquery selectors can easily locate a set element, which is clearer and easier to express than using iterative rules in Asp.net.
2. Use the CSS class instead of styling.
Another inintuitive technique is to use the CSS class as a flag. Like 'selector engin', The 'flag' class is also amazing.
For example, a recent activity is an online card game that can interact with clients. One requirement is that a card needs an onclick haddler at a specific time, but these events only target those face down (face down. As A. Net developer, I can immediately think of a way to number these cards through a collection on the client. Then I can give this data an onclick handlers as needed. This is acceptable, but it is difficult to maintain and messy.
Now, if I use the CSS class to implement face up cards, I add a 'flipped 'class to them using the addclass method, and then I can use a simple' $ (". card: Not (. flipped) ") 'select the cards for face down. Using the click (FN) function of jquery allows me to use several linesCodeThis function is implemented. More importantly, it is easier to understand and read.
The following are some original English Versions:
3. Understand unobtrusive JavaScript.
In the ASP. net World, we use a lot of what's sometimes termed obtrusive JavaScript. this means that client-side event handlers are defined as attributes on elements. for example, several ASP. net webcontrols render an onclick = "javascript :__ dopostback ()" attribute as part of their markup. this is considered obtrusive JavaScript.
When ASP. net was initially being developed, this inline JavaScript was the norm. however, as browsers began providing more sophisticated faculties for imperatively adding event handlers, this declarative technique quickly lost favor with client-side developers. as a consequence, the preferred approach has shifted toward what's called unobtrusive JavaScript.
Unobtrusive Javascript is now considered a best practice when wiring up client-side event handlers. this is primarily because it facilitates separation of concerns between behavioral JavaScript and structural HTML markup. unobtrusive JavaScript also helps you to write cleaner, more semantic markup, which improves accessibility and often has Seo benefits.
Use the console to learn interactively.
Coming from the save-compile-Reload paradigm of Statically typed server-side development, it's natural to approach client-side development in a similar fashion. while you certainly can write client-side code that way, It's akin to working blindfolded when you consider the alternatives. since Javascript is usually interpreted by a browser, the browser is one of the best Debugging Environments available. in particle, a javascript "console" is terrific for interactively interrogating the Dom, testing jquery selectors against actual markup, and refining JavaScript code in real-time.
My preferred browser-based tool isFirebug addon to Firefox. I cannot praise this firebug highly enough. It has revolutionized how I approach client-side development, both of JavaScript and of CSS. If you prefer Internet Explorer,IE8'sUpdated developer tools are also very capable in this department.
Whatever your browser of choice, I urge you to give these utilities a try when debugging client-side functionality. once you become proficient with one of these tools, you'll be amazed that you ever developed client-side code without it.
Get the vsdoc.
Even though browser-based tools are great for debugging, an ASP. net developer's primary editor is still going to be Visual Studio. when writing jquery code in Visual Studio, having proper intelliisense can make a tremendous difference in productivity. the discoverability that intelliisense provides is especially beneficial when you're unfamiliar with jquery's API. as part of the official support for jquery, Microsoft provides a documentation file to provide jquery intelliisense internal Visual Studio 2008. this is provided through what's called a vsdoc file, and is available on the jquery download page (via the" Documentation: Visual Studio "links ).
jeff king has assembled an excellent FAQ To Help You Get Visual Studio 2008's JavaScript intelliisense working: http://blogs.msdn.com/webdevtools/archive/2008/11/18/jscript-intellisense-faq.aspx