2

I am developing the appllcaition based on given link with javascript and html5.

https://msdn.microsoft.com/en-us/windows/uwp/get-started/create-a-hello-world-app-js-universal

But in this link they have used WinJs template to develop the application .But i want to develop the application without the WinJs support. So can you please suggest to develop the application without the WinJs template.

Sasi Dhivya
  • 501
  • 2
  • 7
  • 25

1 Answers1

3

But i want to develop the application without the WinJs support.

It is possible. WinJS is just a javascript library. You can use any js lib that you like to build your app, just like web development. But there are a few things you need to care about:

  1. App Lifecycle: you will need to implement the app lifecycle events in your app,without WinJS, you can implement the lifecycle using below codes:

    Windows.UI.WebUI.WebUIApplication.addEventListener("activated", activatedEventhandler, false);
    Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", suspendingEventhandler, false);
    Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingEventhandler, false);
    

    Here is a complete sample of App lifecycle:Lifecycle Sample.

  2. It is strongly recommended to make your app a Single Page Application. And here is a case that describes the advantages and disadvantages.
  3. For security reason, UWP doesn't support inline javascript. So something like this won't work: <button onclick="someFunc()">Click Me</button>
Community
  • 1
  • 1
Elvis Xia - MSFT
  • 10,801
  • 1
  • 13
  • 24
  • The first [link](https://code.msdn.microsoft.com/windowsapps/App-activating-and-ec15b168) is invalid(thanks MS!). But the [Wayback Machine](https://web.archive.org/web/20130705021207/http://code.msdn.microsoft.com/windowsapps/App-activating-and-ec15b168/view/SourceCode#content) still has it. Some general non-code info on the lifecycle [here](https://learn.microsoft.com/en-us/windows/uwp/launch-resume/app-lifecycle#app-resume) too. – gekkedev Jan 15 '21 at 15:45