locked
win 8 app development through javascript

    Question

  • There is newly released javascript library called navigator.battery. How do I use it in my windows 8 app development as it is not included in WinJs as far as I know. If exists please let me know
    Friday, December 7, 2012 5:21 PM

Answers

  • I presume you're referring to this API: https://developer.mozilla.org/en-US/docs/DOM/window.navigator.battery ?

    If that's the case, then it doesn't look like that is supported in IE 10 which means it isn't supported in WinJS currently. There doesn't appear to be any native equivalent either as per this previous post: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/3a51c7e6-3869-4efe-bb9a-70b6956b880e

    • Proposed as answer by got.dibbs Monday, December 10, 2012 3:46 PM
    • Marked as answer by Song Tian Friday, December 14, 2012 9:28 AM
    Friday, December 7, 2012 5:40 PM
  • Hi Faysal,

    As got.dibbs mentioned, the window.naviagor.battery feature is documented as experimental on mozilla's developer site.

    For windows store app with HTML + javascript, it rely on the same core engine of IE 10 and has some different from standard web pages hosted in IE 10. For HTML or javascript feature supported in windows store javascript based app, you should refer to the IE 10 and windows store specific API references:


    #Internet Explorer 10 Guide for Developers (Windows)
    http://msdn.microsoft.com/en-us/library/ie/hh673549(v=vs.85).aspx

    #HTML, CSS, and JavaScript features and differences (Windows Store apps) (Windows)
    http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Friday, December 14, 2012 9:28 AM
    Tuesday, December 11, 2012 7:46 AM
    Moderator

All replies

  • I presume you're referring to this API: https://developer.mozilla.org/en-US/docs/DOM/window.navigator.battery ?

    If that's the case, then it doesn't look like that is supported in IE 10 which means it isn't supported in WinJS currently. There doesn't appear to be any native equivalent either as per this previous post: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/3a51c7e6-3869-4efe-bb9a-70b6956b880e

    • Proposed as answer by got.dibbs Monday, December 10, 2012 3:46 PM
    • Marked as answer by Song Tian Friday, December 14, 2012 9:28 AM
    Friday, December 7, 2012 5:40 PM
  • Hi Faysal,

    As got.dibbs mentioned, the window.naviagor.battery feature is documented as experimental on mozilla's developer site.

    For windows store app with HTML + javascript, it rely on the same core engine of IE 10 and has some different from standard web pages hosted in IE 10. For HTML or javascript feature supported in windows store javascript based app, you should refer to the IE 10 and windows store specific API references:


    #Internet Explorer 10 Guide for Developers (Windows)
    http://msdn.microsoft.com/en-us/library/ie/hh673549(v=vs.85).aspx

    #HTML, CSS, and JavaScript features and differences (Windows Store apps) (Windows)
    http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Friday, December 14, 2012 9:28 AM
    Tuesday, December 11, 2012 7:46 AM
    Moderator