javascript - Which is better: mobile/desktop code in same file, or in separate files? -


say example have markup...

<p class="remove-mobile remove-tablet add-desktop">this desktop</p> <p class="add-mobile add-tablet remove-desktop">this mobile device</p> 

...paired css...

@media , (//code goes here) {    //code goes here } 

would better (in terms of page speed, page load , forth) above, or better have mobile code in different file desktop code, , use kind of javascript "hey, you're on mobile device. i'm going show file" or "hey, you're on desktop, here's different file"?

i've seen professional companies former latter, i'm confused more optimal.

quote google : it's better have responsive webpage not 2 different layouts
google says recommended have mobile ready page , not redirect ( or warn user change other design ).
, webpage speed there not difference between non responsive layout , responsive one.
p.s. : forgot place read tip in mobile ready checker or webmaster tools.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -