Browsing Tag »JavaScript«

How I understood monads, part 2/2: have we met before?

June 29, 2010

The first post in this series can be found here: http://weblogs.asp.net/bleroy/archive/2010/06/16/how-i-understood-monads-part-1-2-sleepless-and-self-loathing-in-seattle.aspx Last time , I tried to explain how beer and Lou helped me finally understand monads. I gave a couple of trivial examples. Hopefully now that you have this new functional hammer, everything will start looking like a nail. So let’s have a look at a few screws this time. Like last time, I’ll be pretty liberal with the definition of a monad as long as the spirit of monads seems to be preserved. Feel free to nitpick in the comments ;) Oh yeah, jQuery is a monad In jQuery, you first create a wrapped set of HTML elements and then execute operations on it, the result of which is...(read more)

20 Tips and Tricks For Writing Fast Web Applications

June 10, 2010

I’m about 30 minutes from walking on stage to present my last session here at TechEd 2010 in New Orleans and I wanted to share this presentation early, just in case the session room fills up and folks can’t make it in or for those of you who weren’t able to make it.  If you’re Read More......(read more)

Browser Speed: It’s Not All About JavaScript

June 10, 2010

On Tuesday, I presented my IE9: A Lap Around for Developers session here at TechEd and it went really well, it was a lot of fun, and the “slide” deck that I presented worked well!  As it turns out, Joab Jackson, a reporter for the IDG News Service was in the audience and wrote a Read More......(read more)

Ajax Talk at .NET Developers Association

May 25, 2010

Thanks everyone who came to my Ajax talk tonight at the .NET Developers Association ! The slides and demos from the talk can be downloaded by clicking the following link: ASP.NET Ajax: What’s New? You need Visual Studio 2010 to view the code samples. The first project, named Demos, contains the following samples: ASPAjax4 1_CompositeScripts.aspx – Demonstrates how to use the ScriptManger to combine, compress, and cache JavaScript files automatically. 2_EnableCdn.aspx – Demonstrates how to retrieve ASP.NET Ajax framework scripts from the Microsoft Ajax CDN automatically. jQuery 1_Selectors.aspx – Demonstrates how to use jQuery selectors 2_WebForms.aspx – Demonstrates how to use the client tablesorter plugin with ASP.NET Web Forms. 3_MVC.aspx...(read more)

JavaScript local alias pattern

May 18, 2010

Here’s a little pattern that is fairly common from JavaScript developers but that is not very well known from C# developers or people doing only occasional JavaScript development. In C#, you can use a “using” directive to create aliases of namespaces or bring them to the global scope: namespace Fluent.IO { using System; using System.Collections; using SystemIO = System.IO; In JavaScript, the only scoping construct there is is the function, but it can also be used as a local aliasing device, just like the above using directive: ( function ($, dv) { $( "#foo" ).doSomething(); var a = new dv( "#bar" ); })(jQuery, Sys.UI.DataView); This piece of code is making the jQuery object accessible using the $ alias throughout the code...(read more)

jQuery and Windows Azure

May 10, 2010

The goal of this blog entry is to describe how you can host a simple Ajax application created with jQuery in the Windows Azure cloud. In this blog entry, I make no assumptions. I assume that you have never used Windows Azure and I am going to walk through the steps required to host the application in the cloud in agonizing detail. Our application will consist of a single HTML page and a single service. The HTML page will contain jQuery code that invokes the service to retrieve and display set of records. There are five steps that you must complete to host the jQuery application: Sign up for Windows Azure Create a Hosted Service Install the Windows Azure Tools for Visual Studio Create a Windows Azure Cloud Service Deploy the Cloud Service Sign...(read more)

Free WebCamps – North America, Asia and Europe – *Sign Up Now*

May 2, 2010

A few days ago on Twitter @ red7_liu tweeted: ???Web Camps??????????Scott Hanselman??. This part "??" as I understand, effectively means "Big Cow." "Microsoft Web Camps Conference is coming to China, Big Cow Scott Hanselman will come." If that's not a good enough reason to go to Microsoft WebCamps , then what is? ;) This isn't a conference, it's a camp, like a classroom. Here's the schedule . Day 1: Learning: Web Platform from the ground up Day 2: Hack day, labs and building apps in teams First day we learn, second day we code. What are Web Camps?   Web Camps are free, two-day events that allow attendees to learn and build on the Microsoft Web Platform. At camp, they will hear from Microsoft...(read more)

jQuery, ASP.NET, and Browser History

April 9, 2010

One objection that people always raise against Ajax applications concerns browser history. Because an Ajax application updates its content by performing sneaky Ajax postbacks, the browser backwards and forwards buttons don’t work as you would normally expect. In a normal, non-Ajax application, when you click the browser back button, you return to a previous state of the application. For example, if you are paging through a set of movie records, you might return to the previous page of records. In an Ajax application, on the other hand, the browser backwards and forwards buttons do not work as you would expect. If you navigate to the second page in a list of records and click the backwards button, you won’t return to the previous page. Most likely...(read more)

Netflix, jQuery, JSONP, and OData

April 1, 2010

At the last MIX conference, Netflix announced that they are exposing their catalog of movie information using the OData protocol. This is great news! This means that you can take advantage of all of the advanced OData querying features against a live database of Netflix movies. In this blog entry, I’ll demonstrate how you can use Netflix, jQuery, JSONP, and OData to create a simple movie lookup form. The form enables you to enter a movie title, or part of a movie title, and display a list of matching movies. For example, Figure 1 illustrates the movies displayed when you enter the value robot into the lookup form. Using the Netflix OData Catalog API You can learn about the Netflix OData Catalog API at the following website: http://developer...(read more)

A C# implementation of the CallStream pattern

March 31, 2010

Dusan published this interesting post a couple of weeks ago about a novel JavaScript chaining pattern: http://dbj.org/dbj/?p=514 It’s similar to many existing patterns, but the syntax is extraordinarily terse and it provides a new form of friction-free, plugin-less extensibility mechanism. Here’s a JavaScript example from Dusan’s post: CallStream( "#container" ) (find, "div" ) (attr, "A" , 1) (css, "color" , "#fff" ) (logger); The interesting thing here is that the functions that are being passed as the first argument are arbitrary, they don’t need to be declared as plug-ins. Compare that with a rough jQuery equivalent that could look something like this: $.fn.logger = function () { /* ... *...(read more)