M
M
mydarck2016-04-21 10:16:10
css
mydarck, 2016-04-21 10:16:10

How to remove extra code when viewing a site on mobile devices?

I got a "responsive" site. Responsiveness is implemented using Bootstrap 3. To display the necessary content on mobile devices, unnecessary blocks were hidden by classes like: hidden-xs, etc.
As a result, the goal seems to have been achieved, however, at the same time, unnecessary traffic is downloaded on mobile devices, although it is hidden from the user's eyes.
Is it possible to remove unnecessary hidden code for mobile devices without converting the site to mole versions on the m.syte.ru subdomain?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim Babichev, 2016-04-21
@REZ1DENT3

Can't be removed. Everything will be downloaded! You will have to make a site on m.example for mobile phones.

K
Konstantin Velichko, 2016-04-21
@Zoxon

Check by useragent and simply do not display the banal if
But there are pitfalls here.

V
Viktor Taran, 2016-04-21
@shambler81

this can only be done using php.
We, in turn, made our own tag that already checks which device and then deletes everything from php, including itself if it is a phone.
The only way.
The bootstrap itself is just a layout.

A
Alexander Ruzhevich, 2016-05-30
@ruzhevich

get the screen resolution like here www.php.net/manual/ru/faq.html.php#faq.html.javasc...
then output the desired content via if else and don't need a new domain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question