Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DeveloperInfra/6201819 to your computer and use it in GitHub Desktop.
Save DeveloperInfra/6201819 to your computer and use it in GitHub Desktop.
Using jQuery To Build Windows Store Apps Demo. Open Microsoft Visual Studio >> File >> New Project >> JavaScript >> Windows Store >> Blank App
/*
<body>
<p id="demo">Content goes here</p>
</body>
*/
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkId=232509
(function (window, $, undefined) {
"use strict";
WinJS.Binding.optimizeBindingReferences = true;
var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;
app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
// TODO: This application has been newly launched. Initialize
// your application here.
} else {
// TODO: This application has been reactivated from suspension.
// Restore application state here.
}
args.setPromise(WinJS.UI.processAll());
}
};
app.oncheckpoint = function (args) {
// TODO: This application is about to be suspended. Save any state
// that needs to persist across suspensions here. You might use the
// WinJS.Application.sessionState object, which is automatically
// saved and restored across suspension. If you need to complete an
// asynchronous operation before your application is suspended, call
// args.setPromise().
};
$(function () {
$('#demo').text('Hello World!');
});
app.start();
})(window, jQuery);
@DeveloperInfra
Copy link
Author

Quick demo code used in my talk titled Using jQuery To Build Windows Store Apps. Please click the link to view the abstract as well as to find links to other downloads, resources, recordings, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment