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
Post a Comment