Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Single post in HTML minification

Forum Index > Core > Announcements > News Archive > HTML minification >

Niet [Adam]'s AvatarNiet [Adam]
Niet [Adam]'s Avatar
Okay, that thread name probably means nothing to you :p Basically I've added some code that removes all newlines and tabs from pages. Usually when I write HTML, it's like this: <body> <div> <span>Hello there!</span> </div> </body> This "whitespace" is completely useless when it comes to actually displaying the page. The only purpose it serves is to make it easier to program. So I've added some code to automatically remove as much of those spaces as possible. This can mean a single page becomes several kilobytes smaller, and for people on slower connections that can really add up! However, there's one major downside: it's a bit of a nuke. Forum posts, for example, keep all the newlines and spaces that you type in them (as demonstrated by my code example above). ... Of course, now that I'm writing this, I just thought of a way I could have easily avoided all the trouble (just replace newlines with &#10; and tabs with &#9;, their HTML entities... but then again, that starts taking up more space again, so... nevermind!) Anyway, the point is, if you see words smushed together anywhere, please let me know because it might be caused by the code eating too much of the spaces!
Clip from Pokémon anime, re-lined by me
-- OMNOMNOM!
Featured story: Injustice Feedback welcome!
© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page