Windows 8 and JS: Gotchas

Learning a new platform is never easy. Some things that should require minutes to accomplish, bring hours of frustration and disappointment. Today I am going to write about a couple of possible pitfalls when developing a JavaScript Metro app for windows 8. As you may know Windows 8 platform natively supports Metro app development using the web technology stack: JavaScript, HTML and CSS. Not only that, it also implements the latest and greatest CSS3 and ECMAScript 5 features. You can also access all Windows 8 API via JavaScript. The new WinRT (Windows Runtime) is an impressive piece of software.

WinRT as show at BUILD conference

WinRT as show at BUILD conference

I would like to tell you a couple of problems that you might encounter while working with Windows 8. Please note that these are not necessarily difficult issues, however they can cause some frustration.

Debugging.

Most if not all front end developers use some sort of debugging tools while they are working. Some prefer Firebug others prefer Chrome Developer Tools,  however Windows 8 Metro apps can not be viewed via a browser and thus those tools can not be used. Solution: Windows DOM Explorer. Simply launch your app inside a simulator and click Debug->Windows->DOM Explorer. Quick tip – pin the simulator to your screen so it doesn’t hide when you browse the DOM. Also many developers prefer using JavaScript alert() for debugging, yet in Windows 8 you can not do that. The proper way to print out some information is to use console.log() , which shows up inside the JavaScript Console in the bottom left side of your Visual Studio window. All in all, the debugging capabilities are pretty solid, however at the moment the DOM explorer still lacks features when compared to Firebug or Chrome developer tools.

Next time we will look into native HTML templating…

2 Responses to “Windows 8 and JS: Gotchas”
  1. It’s truly a great and useful piece of information. I am satisfied that you shared this useful info with us. Please keep us informed like this. Thank you for sharing.

  2. Kellee

    I see you don’t use the power of social websites like twitter and facebook on your site.
    You can get huge traffic from social sites on autopilot using one useful tool, for more
    info search in google for:
    Alufi’s Social Automation

Leave a Reply