locked
onactivated vs onloaded - which one is called first

    Question

  • I am little confused about which one is called first. Kraig's free ebook (page 105) has sequence of events and it shows shows that activated is invoked loaded. However MDSN documentation at http://msdn.microsoft.com/en-us/library/windows/apps/br229840.aspx states that onLoaded is called before activated as well. In my test code, onload executes before onactivated which is inline with what is MSDN. Does the book describes these event sequence incorrect or am I simply misunderstanding it ?
    Wednesday, April 03, 2013 11:33 PM

Answers

  • That's an error in the book. Loaded does come first (as I mention for the web context anyway). I think it changed since a year ago when I originally wrote that material. Looking at the WinJS source code, it's queued after DOMContentLoaded. Thanks for pointing it out.

    • Marked as answer by Kam2011 Thursday, April 04, 2013 12:01 AM
    Thursday, April 04, 2013 12:01 AM

All replies

  • That's an error in the book. Loaded does come first (as I mention for the web context anyway). I think it changed since a year ago when I originally wrote that material. Looking at the WinJS source code, it's queued after DOMContentLoaded. Thanks for pointing it out.

    • Marked as answer by Kam2011 Thursday, April 04, 2013 12:01 AM
    Thursday, April 04, 2013 12:01 AM
  • Thank you for prompt reply Kraig, much appreciated.

    Thursday, April 04, 2013 12:02 AM