You are browsing the archive for JavaScript.

by Editor

The Big Glossary of Open Source JavaScript and Web Frameworks with Cool Names

April 13, 2012 in Articles, ASP.NET, News, Reference

It's getting to the point where there are so many cool open source projects that I can't keep up. When you add in the currently battle royale of JavaScript projects that are basically just hip sounding words with ".js" added to the end, it's a little overwhelming. Seriously, just pick a word out of the dictionary at random and that's the name of an up and coming JavaScript library. JavaScript MVC Frameworks and Libraries This is an area that is very interesting but also very not-yet-baked. In the DOM manipulation and CSS selector space, jQuery won. That fight is over. The next big question is client side MVC frameworks. It seems everyone wants to make the next "Rails" framework on JavaScript and while there…(read more)

by Editor

Drawing transparent glyphs on the HTML canvas

March 17, 2012 in Articles, ASP.NET, News, Reference

The HTML canvas has a set of methods, createImageData and putImageData, that look like they will enable you to draw transparent shapes pixel by pixel. The data structures that you manipulate with these methods are pseudo-arrays of pixels, with four bytes per pixel. One byte for red, one for green, one for blue and one for alpha. This alpha byte makes one believe that you are going to be able to manage transparency, but that’s a lie. Here is a little script that attempts to overlay a simple generated pattern on top of a uniform background: var wrong = document.getElementById( "wrong" ).getContext( "2d" ); wrong.fillStyle = "#ffd42a" ; wrong.fillRect(0, 0, 64, 64); var overlay = wrong.createImageData(32, 32), data…(read more)

by Editor

VS11 Beta JavaScript Feature comparison with VS2010sp1

March 15, 2012 in Articles, News, Reference

In Visual Studio 11 Beta, we have exciting JavaScript editing features for the developers. Last year, we blogged “ JavaScript Web development differences between Visual Studio 11 Developer preview and Visual Studio 2010 ”. Here are the differences between Visual Studio 11 Beta and Visual Studio 2010 . IntelliSense Description VS2010 Behavior Visual Studio 11 Beta Behavior Changed From VS11 Developer Preview ECMAScript 5 compliance No Yes. Visual Studio 11 Developer Preview fully supports ECMAScript 5. Auto-reducing Statement Completion List No Yes, if the IntelliSense is automatically enabled when typing. The following screen shots shows all the document's statement completion items that contains character "al": Completion Hint…(read more)

by Editor

On the nightmare that is JSON Dates. Plus, JSON.NET and ASP.NET Web API

March 6, 2012 in Articles, ASP.NET, News, Reference

Ints are easy. Strings are mostly easy. Dates? A nightmare. They always will be. There's different calendars, different formats. Did you know it's 2004 in the Ethiopian Calendar? Yakatit 26, 2004, in fact. I spoke to a German friend once about how much 9/11 affected me and he said, "yes, November 9th was an amazing day in Germany, also." Dates are hard. If I take a simple model: public class Post { public int ID { get; set; } [StringLength(60)][Required] public string Title { get; set; } [StringLength(500)] [DataType(DataType.MultilineText)] [AllowHtml] public string Text { get; set; } public DateTime PublishedAt { get; set; } } And I make a quick ASP.NET Web API controller from VS11 Beta (snipped some stuff for simplicity…(read more)

by Editor

One ASP.NET – Making JSON Web APIs with ASP.NET MVC 4 Beta and ASP.NET Web API

February 25, 2012 in Articles, ASP.NET, News, Reference

ASP.NET MVC 4 Beta came out last week. It's got lots of new features as well as some surprises that move us closer to the "One ASP.NET" idea. I talked about this a little in this week's MSDN Flash email newsletter (you can subscribe to MSDN Flash here ; it's reasonably high signal, low noise). Here's part of what I said : Don't think of ASP.NET as an island. It's a citizen of the larger community. More and more of ASP.NET is open source, and we push hard every day to stay open and be open. We want to make ASP.NET more pluggable, more open, more fun. We've got big things planned – some that will surprise you. I hope you'll join the conversation and the community. Here's some of the stuff that's…(read more)

by Editor

Solving the Shakespeare Million Monkeys Problem in Real-time with Parallelism and SignalR

November 12, 2011 in Articles, ASP.NET, News, Reference

A little over 18 months ago I was talking to Stephen Toub (he of the Parallel Computing fame ) about parallelism and the kinds of problems it could solve. I said, naively, "could we solve the million monkey's problem ?" He said, "the what?" "You know, if you have an infinite number of monkeys and an infinite number of keyboards they will eventually write Shakespeare ." We brainstormed some ideas (since Stephen is a smarter than I, this consisted mostly of him gazing thoughtfully into the air while I sat on my hands) and eventually settled on an genetic algorithm. We would breed thousands of generations of (hypothetical) monkeys a second and then choose which ones would be allowed to perpetuate the species based…(read more)

by Editor

JavaScript Reference group Dedicated Worker

September 30, 2011 in Articles, News, Reference

Travis Leithead showed a video "Building responsive apps and sites with HTML5 web workers" in BUILD. When editing "Dedicated worker" JavaScript file in Visual Studio 11 Developer's Preview, we need to add the following line in the beginning of the file to get the proper JavaScript web walker IntelliSense in the editor: /// <reference group="Dedicated Worker" /> "Dedicated Worker" is a reference Group defined in the Tools->Options->Text Editor->JavaScript->IntelliSense->References. It contains a JavaScript file which contains all the web walker JavaScript HTML5 objects. You can then see IntelliSense, such as importScripts: Also, IntelliSense will be shown form the JavaScript files…(read more)

by Editor

New JavaScript editing features for Web development in Visual Studio 11 Developer Preview

September 15, 2011 in Articles, News, Reference

Visual Studio 11 Developer Preview has the JavaScript design time engine rewritten, sharing base with IE's JavaScript engine. It has faster performance and better memory footprint. The list below shows some new feature and changes comparing with Visual Studio 2010 for Web development scenarios. All feedbacks are welcomed as it's our passion to make JavaScript developing experience as pleasant, reliable and efficient as other languages. IntelliSense Description VS2010 Behavior Visual Studio 11 Developer Preview Behavior ECMAScript 5 compliance No Yes. Visual Studio 11 Developer Preview fully supports ECMAScript 5. Auto-reducing Statement Completion List No Yes, if the IntelliSense is automatically enabled when typing. The following screen…(read more)

by Editor

Asynchronous scalable web applications with real-time persistent long-running connections with SignalR

August 29, 2011 in Articles, ASP.NET, IIS, News, Reference

I've been spending some time exploring asynchrony and scale recently. You may have seen my post about my explorations with node.js and iisnode running node on Windows . Every application has different requirements such that rules to "make it scale" don't work for every kind of application. Scaling a web app that gets some data and for loops over it is different from an app that calls out to a high-latency mainframe is different from an app that needs to maintain a persistent connection to the server. The old adage "when all you have it is a hammer everything looks like a nail" really holds true in the programming and web space. The more tools – and the knowledge to use them – the better. That's why I'm an…(read more)

by Editor

Learning about Progressive Enhancement – Supporting Mobile Browsers with CSS3 Media Queries

August 25, 2011 in Articles, ASP.NET, ASP.NET MVC, News, Reference

I blogged about how happy I've been working with designer Jeremy Kratz on my recent site redesign . We've been meeting lately about small improvements and tweaks. One of the core goals was to support many screen sizes from 30" down to a small smart phone screen. You can see the results on the right in a Windows Phone and iPhone. My team is doing a lot of work on Mobile lately, not just with things like jQuery Mobile and what that means not just for ASP.NET but the mobile web in general. We've also worked with 51Degrees and they've even created a NuGet package that can help you tailor your site to any device. You'll hear more about Mobile in ASP.NET from Steve soon and I'll be sharing some ideas in a few upcoming…(read more)