Obscure HTML Tags
devapt.com
devapt.com
While I don't code in HTML directly, I write the mark-up in Org mode that exports to those.
- My recent blog post where I used mark few times (I have set the mark highlight to be brownish to match my site theme) and also the description lists: https://scripter.co/hugo-modules-getting-started/
- In some other posts, I use details/summary to collapse large code blocks.
The way to achieve the same effect without this problem is to include the nojs content unconditionally, and then have your script delete it from the DOM somewhere far enough through execution that you're confident that your script and its dependencies are all running properly. Otherwise you end up in situations where the JS is broken because something is being blocked, but it's working just well enough that the browser isn't showing the nice message you wrote explaining what the problem is.
- noscript
- js failed to init
- app loaded
I’m very big on graceful failure though because it builds systems that you can really trust.
A simple alternative if you want to display something to users who have JS entirely disabled (i.e. not partially) is to use a CSS class 'nojs' and inline <script> very early in the file. If you're happy to assume a HTML5 browser:
<script>document.write("<style>.nojs{display:none}</style>")</script>
and if not: <script type="text/javascript">document.write("<style type='text/css'>.nojs{display:none}</style>")</script>
If running on a browser that doesn't support CSS or JS, this will display the 'nojs' content, which is probably what you want. You can of course use this method without <script> to provide a 'nocss' class that will display on CSS-incapable browsers.I prefer this over the method of deleting a DOM node after everything has been loaded and parsed, because this inline script is guaranteed to take effect before the 'nojs' content is reached so it's impossible for the 'nojs' content to be temporarily flashed to users on a slow connection (https://en.wikipedia.org/wiki/Flash_of_unstyled_content). It's also a bit more versatile (you can place the 'nojs' anywhere, use it for alternative form elements etc.), and it's short.
If you want to do something more like progressive enhancement, where the default is to not show something fancy unless JS loads successfully, add a 'js' class, where an inline <style> sets display:none, followed by JS which overrides the inline style to make 'js' elements visible again. Similarly with elements you want to display (or not) depending on specific feature detections.
For one it lets you create logical groupings and paired with legend give you a header type element.
The main bonus is if you add the attribute "disabled" it will disable all the child form elements. Which makes it very simple to lock a form when it's being submitted to the server
Don't tell that to the billion-dollar healthcare company I'm currently building a web site for.
Just make a dialog with a div like you've always have been.
That nine year journey was tracked here: https://bugzilla.mozilla.org/show_bug.cgi?id=840640
I've been using what now seems like a horrible hack, p class="help" to make help boxes that expand on mouseover all this time.