P
P
postgresdev2019-10-31 21:25:19
Handlebars
postgresdev, 2019-10-31 21:25:19

How to check the current browser in handlebars?

you need to get the name of the current browser ie or edge.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Bogachev, 2019-10-31
@sfi0zy

Handlebars is a templating engine. It turns one line into another and has nothing to do with browsers. If your task is to compile templates differently for different browsers, then you need to separately obtain the browser version, and then pass it to this library as part of the context for the template.
Since you can collect these templates in many places, including on the server, which is a very loose concept, your question is very general. If you collect templates on the client, then everything is simpler, you can take for example a bowser and use the result from it directly when building Handlebars templates.
But in general, different assembly of templates for different browsers is a very controversial practice, in the long run it is almost always easier to make something cross-browser than to crutch everything like that, especially when it comes to modern browsers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question