(X) Hide this
    • Login
    • Join
      • Generate New Image
        By clicking 'Register' you accept the terms of use .

Detecting Phone, Desktop or Web with WinJS

(0 votes)
0 comments   /   posted by Silverlight Show on Jun 23, 2014
Tags:   windows-phone , wpdev , windows-store , winjs , timmy-kokke
Read original post at Timmy Kokke's Blog

I’m my previous post I showed how you can add a website to a universal project and share some JavaScript between all three. This is nice, but I will run into a situation where you’ll have some code that is not supposed to run on one of the platforms. In the C# world you can use compiler directives in situations like this. In JavaScript this is not possible (Although you could create constructions that mimic directives using Grunt for example). WinJS has some functionality build in that can help finding out what platform you are using.


No comments

Add Comment

Login to comment:
  *      *       

Our News on Twitter