My index.pug file looks like this:
head
script(type="text/javascript").
var isMobile = (screen.width || window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= 480;
body
if isMobile
include nav_mobile
else
include nav
I wrote the above code but don't get the desired result. (isMobile
seems to be always null
)
How can I get the value of the JavaScript variable to pug?