Browse by Tags
All Tags »
jQuery (
RSS)
I’ve already posted twice about that little class browser application. The first iteration was mostly declarative and can be found here: http://weblogs.asp.net/bleroy/archive/2009/09/14/building-a-class-browser-with-microsoft-ajax-4-0-preview-5.aspx The second one was entirely imperative and can be found here: http://weblogs.asp.net/bleroy/archive/2009/10/15/entirely-unobtrusive-and-imperative-templates-with-microsoft-ajax-4-preview-6.aspx This new version builds on top of the code for the imperative version and adds the jQuery dependency in an attempt to make the code leaner and simpler. I invite you to refer to the imperative code (included in the archive for this post ) and compare it with the jQuery version, which shows a couple of ways...
Today is the release of the sixth preview of Microsoft Ajax Library. Don’t get fooled by the somewhat silly and long name: this is a major release in many ways. The scripts have been majorly refactored since preview 5. Check out the other posts out there (links at the bottom of this post) to see just some of the many new features that are in there. Some of my favorite are all the small improvements that have been made to make imperative instantiation of components and templated contents easier than ever. Many of you have told us that you preferred to do things imperatively and this release makes it a lot better. When Preview 5 came out, I built a simple class browser using the declarative syntax. The class browser shows the hierarchy of namespaces...
In today’s post, I’m going to show an interesting technique to solve a problem and then I will tear it to pieces and explain why it is actually useless. I believe that negative results should also be published so that we can save other people from wasting time trying the same thing. So here goes… A few days ago, a post on Ajaxian proposed a new version of a somewhat old technique to implement querySelectorAll on old versions of IE, using the browser’s native CSS engine. That sounds like a great idea at first, and the hack is quite clever. The idea is to dynamically add a CSS rule to the document that has the selector that you want to evaluate, and an expression that adds the matched elements to a global array. When I read this, it reminded me...
If you haven’t already and you are a .NET developer, please take a couple minutes and answer this survey, whether you use Ajax or not. There are a number of Ajax surveys around, but Simone’s is the only one that focuses on .NET developers. The survey: http://www.zoomerang.com/Survey/?p=WEB22973CYKW2H Simone’s post: http://codeclimber.net.nz/archive/2009/05/21/ajax-usage-among-.net-developers-in-2009.aspx Read More...
NOTE: This was cross posted from here . I’ve been using jQuery quite a bit lately. I’ve grown very fond of it. At the same time, I have been digging into ASP.NET AJAX 4.0. I just read a post from Bertand Le Roy that made me smile. In his post, he shows how you can do the following: < ul class ="dv" > < li > {{ $dataItem }} </ li > </ ul > < script type ="text/javascript" > 1: $( ".dv" ).dataView({ data: [ "foo" , "bar" , "baz" ] }); </ script > To me, being able to instantiate a DataView control using the jQuery plugin syntax is PRETTY COOL! Check out the details of how all this works and download the sample at: http...
We had an interesting discussion recently on the ASP Insiders mailing list and ended up talking about what cool stuff we could build on top of jQuery. Many interesting things were mentioned and it was a very useful discussion but one suggestion in particular struck my curiosity as it was something I had investigated before and that could be improved on with very little code. I had already written a little plugin to enable instantiation of Microsoft Ajax components on the results of a jQuery selector : jQuery.fn.create = function (type, properties) { return this .each( function () { Sys.Component.create(type, properties, {}, {}, this ); }); }; I have another version that is a little more elaborate and takes a bag of properties and events instead...
Disclaimer: I worked on the Microsoft Ajax 4.0 template engine, so my criteria are of course heavily influenced by our own design. Templates are a data rendering method that server-side developers have enjoyed since the old days of classic ASP and PHP. The idea was quite simple (add code blocks and dynamic expressions directly into HTML markup) but it revolutionized web development, which before that relied on the opposite method (spitting HTML from CGI code). On the client-side, the browser provides two ways to generate HTML: innerHTML and the DOM API. Template rendering is of course possible, but only using a JavaScript library. To be honest, one should mention XSLT here, which is standard and widely supported but whose somewhat unusual syntax...
Here’s a little experiment. I’m really after feedback on this one as I’m trying to decide whether this is a good idea. It’s also entirely possible somebody else did this before. That would be good feedback too. Anyway, here it is. Despite its shortcomings, CSS has a number of features that make it very compelling. First, it decouples styling from markup. Second, its selector syntax is simple, yet reasonably powerful. So we have semantic markup on the one hand, and styles on the other hand, and the only coupling between the two is the selectors in the stylesheet. In Ajax applications, there is a third kind of entity in the mix, JavaScript behavior. There are of course ways to decouple the script behavior from the markup, which are usually referred...
Wally McClure, MVP extraordinaire and ASP Insider, just published a short book about the new features in ASP.NET 3.5 SP1 . It is a short and to the point read that should get you started in no time. I wouldn’t have shown web service access as the main advantage of jQuery myself (the selector and animation support adds more value for ASP.NET Ajax developers) but that’s a minor thing, and there are plenty of other resources to learn about jQuery . Topics in Wally’s book include: Ajax History Script Combining (including ScriptReferenceProfiler) jQuery Routing Entity Framework Dynamic Data ADO.NET Data Services http://www.wrox.com/WileyCDA/WroxTitle/New-Features-in-ASP-NET-3-5-Service-Pack-1.productCd-0470457341.html Read More...
Apparently Brian likes our declarative syntax. And jQuery . And he did something quite fun with them, something we had clearly not anticipated: using Microsoft Ajax’s new declarative syntax to call jQuery plug-ins instead of Microsoft Ajax behaviors as was the original intent. < input type ="text" maxlength ="20" size ="40" sys : key =”self” sys : attach =”wajbar” wajbar : submit =”{{ $ ( self ) .next ( ’input : submit’ ) }} ” /> The way he made that possible is by adding a registration step to make the plug-in accessible through sys:attach. This registration API actually creates a wrapper behavior for the plug-in that gets Microsoft Ajax to believe the plug-in is a regular behavior. The actual plug-in gets...
More Posts
Next page »