this post was submitted on 19 Apr 2025
177 points (98.9% liked)
Today I Learned (TIL)
7314 readers
3 users here now
You learn something new every day; what did you learn today?
/c/til is a community for any true knowledge that you would like to share, regardless of topic or of source.
Share your knowledge and experience!
Rules
- Information must be true
- Follow site rules
- No, you don't have to have literally learned the fact today
- Posts must be about something you learned
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Yeah ik. Just confused why Wikipedia itself does it
Does what? Have a separate site for mobile viewing? There's many good reasons..
It would be better to handle it by detecting what device you’re on rather than having encoded into the url. That way it wouldn’t matter what device the page was shared from.
usually it is just a redirection. One of the reasons wiki does this is that their stack is more older device friendly (for the most part, you can use wikipedia perfectly fine without any js), and having adaptive view usually requires js (there are some other ways too), but wiki is constrained. So when browser recieves a request from a mobile user agent, they just redirect to mobile site.
Responsive design usually doesn't need JS, it's mostly pure CSS.
That may be the case, but i have seen websites use js for it. Another thing is, what version of css does wikipedia target, as ye older verisons might not have that.
Sure, some websites do that, but it's simply wrong to say "having adaptive view usually requires js". No, it doesn't, usually responsive design doesn't need JS.
If a browser doesn't support media queries, it would just show the desktop version. Media queries have been broadly supported since 2015. It's possible that Wikipedia still targets older browsers, but IMO it would be fine to show the desktop version on mobile browsers older than that.
Even in my original comment i said there are non js ways. But what i primarly meant here is, there are differnt "ideas" of implementing a mobile site, some just change element sizes, and make them vertical viewing friendly, but others do change quite a lot, for example, remove most clickable items from the header-bar or title bar, and move them to a kebab/hamburger menu. And I know even this particular example can be done in pure css, but I still feel my statement is not simply wrong.
Also I am not a front end dev, so I am sorry if I get stuff wrong.
No, you're right. The important part I wanted to highlight is that the usual way is CSS, not JS. There are a bunch of websites that use JS for this purpose, and probably also many CMSs etc., but doing it using CSS is far more common.
Its not just old devices. I turn js off for security. There's a whole class of high-risk users that this is for. Even on modern hardware and software.
me too, i was simplifying it. I have a global js disable rule, and whitelist a shorter list