Answer the question
In order to leave comments, you need to log in
How can you control the download of scripts for mobile phones?
What is available:
backend from nodejs + expressjs
I would like not to download certain scripts for mobile phones.
how to solve the problem at the moment.
Do not insert scripts with the help of the backend on the condition or in the frontend body.append on the condition?
Answer the question
In order to leave comments, you need to log in
On one of the projects I solved a similar problem as follows.
Grunt builds 2 or more sets - scripts+styles.
Further, during rendering, the user agent and other parameters are determined and the required set of plug-in scripts is substituted.
On the backend, giving different URLs to the same URL depending on the device is not correct. You need to decide on the frontend to load one or another minified and compressed js package. Take a loader, for example: requirejs.org
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question