> ## Content Index
> Fetch the complete content index at: https://blogs.remobjects.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Windows 8 Metro and RemObjects SDK for JavaScript
- URL: https://blogs.remobjects.com/2012/01/16/windows-8-metro-and-remobjects-sdk-for-javascript/
- Published: 2012-01-16T16:45:17.000Z
- Updated: 2018-08-22T06:17:43.000Z
- Author: valeriyg
- Tags: #Import 2026-08-17 20:17

Windows 8 (currently in beta) introduces a new Metro UI that [marc already talked about](https://blogs.remobjects.com/blogs/mh/2011/09/17/p3168) a while back. Metro apps can be written with .NET, native C++ and also with JavaScript.

What that means is that users of Data Abstract or RemObjects SDK have the choice of two development platforms and languages to create Windows 8 applications: either our .NET library or our new JavaScript library.

This blog post here is about my first Metro web application that calls our famous [Mega Demo sample server](http://wiki.remobjects.com/wiki/Mega%5FDemo%5FSample%5F%28Delphi%29?ref=blogs.remobjects.com), using our new RemObjects SDK for JavaScript.

I’ll explain step by step:

## Preparation

Get the Win8 Developer Preview, install it and run Visual Studio.

From the main menu, choose *New Project -> JavaScript -> Blank Application.*

Add the RemObjectsSDK.js and the MegaDemoLibrary\_intf.js to the project’s /js/ folder.

## Editing default.html

Add script tags to the head to include our JavaScript files, add a text area tag to the body (this will be our log window).

| WinWebApp1 |
| ---------- |

\## Editing default.js

Define the **alert** function (which we might need for error messages) and add the service creation/method calling code to the **onmainwindowactivated** function.

| function(){ 'use strict'; // Uncomment the following line to enable first chance exceptions.// Debug.enableFirstChanceException(true); window.alert\=function(msg){ log.value+="alert: "+ msg;} WinJS.Application.onmainwindowactivated\=function(e){ if(e.detail.kind\=== Windows.ApplicationModel.Activation.ActivationKind.launch){ log.value\="trying...\\n";var msg \=new RemObjects.SDK.JSONMessage();var ch \=new RemObjects.SDK.HTTPClientChannel("http://192.168.0.163:8099/JSON");var svc \=new MegaDemoService(ch, msg); svc.Sum(1,2,function(res){ log.value+="1 + 2 = "+ res;}, RemObjects.UTIL.showError); // TODO: startup code here }} WinJS.Application.start(); })(); |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

That’s it. Run the project and enjoy the fact that 1 + 2 = 3 — in a glorious Windows 8 Metro application.