R
R
retyui2015-05-13 20:25:17
JavaScript
retyui, 2015-05-13 20:25:17

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

2 answer(s)
K
kotofey, 2015-05-13
@kotofey

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.

T
Timur Shemsedinov, 2015-05-13
@MarcusAurelius

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 question

Ask a Question

731 491 924 answers to any question