What happens if I have JavaScript disabled (and I do have)?
You don't see anything.
GCC
...
The GNU Compiler Collection
With JS, they'd become margin notes, whithout it, they'd render as plain footnotes.11–20 of 31 posts
What happens if I have JavaScript disabled (and I do have)?
You don't see anything.
GCC
...
The GNU Compiler Collection
With JS, they'd become margin notes, whithout it, they'd render as plain footnotes.Earlier quoted context omitted.
You don't see anything.
Which is bad if them notes are not ornaments only. So there should be some fallback. I guess a good approach would be to collect the content from some p.marginnote elements which would be hidden if JS is present and left intact if not. So, like GCC ... The GNU Compiler Collection With JS, they'd become margin notes, whithout it, they'd render as plain footnotes.
Earlier quoted context omitted.
What do you consider a reasonable reason to build something as a jQuery plugin as opposed to pure-js? or do you believe jQuery plugins are redundant by default? Just interested.
I personally find it odd to create every component as a jquery plugin. To me, it makes more sense to write a plugin only when you're extending jquery core functionality itself in some way. As far as "extending" goes though, it's not always clear. Is a date picker extending jquery's core? I personally think not, but there has evolved an expectation that every web component must be initialized like so: $('#container').…
I've been thinking for a while that it would be nice if we could add events to the CSS syntax, something like:
a[desc] { onMouseOver: asideFunction(); }
I _kind_ of worry that this is subverting the purpose of the css, but since it also handles hover and selected behaviour, it seems like the line isn't well-drawn anyway as to where styling ends and where behaviour begins.
What do other people think?
Earlier quoted context omitted.
You don't see anything.
Which is bad if them notes are not ornaments only. So there should be some fallback. I guess a good approach would be to collect the content from some p.marginnote elements which would be hidden if JS is present and left intact if not. So, like GCC ... The GNU Compiler Collection With JS, they'd become margin notes, whithout it, they'd render as plain footnotes.
GCC[1]
…
1. The GNU Compiler Collection
It's compatible with the W3C recommended idiom for footnotes[2], is accessible without JavaScript, and you can still use `.marginnote` to provide CSS styling.[2]: https://www.w3.org/TR/html5/common-idioms.html#footnotes
Earlier quoted context omitted.
I personally find it odd to create every component as a jquery plugin. To me, it makes more sense to write a plugin only when you're extending jquery core functionality itself in some way. As far as "extending" goes though, it's not always clear. Is a date picker extending jquery's core? I personally think not, but there has evolved an expectation that every web component must be initialized like so: $('#container').…
Basically, this function is just an onMouseOver event, which then inspects the element and displays text from the "desc" tab in the right place. I've been thinking for a while that it would be nice if we could add events to the CSS syntax, something like: a[desc] { onMouseOver: asideFunction(); } I _kind_ of worry that this is subverting the purpose of the css, but since it also handles hover and selected behaviour,…
What happens if I have JavaScript disabled (and I do have)?
So you can tell us: what happens if you have Javascript turned off?
I have sympathy for the "what happens if I'm using a screen reader or other accessibility device" question, not excluding those who need to use assertive technologies where possible is important. geocar's post below suggests what might be a better implementation in that regard, which will support your use case too, but some advanced screen readers might try run the script (to access generated content like Google does for indexing) and then not read the text because said code has hidden it via DOM manipulation, meaning the technique might not work in all cases.
But disabling all javascript and expecting the world to support your preference in everything we produce (you can at least read be core content in this case) feels a bit entitled IMO, along the lines of people/companies (who I deal with in my day job) who use legacy browsers and are upset when that means they can't have shiny new features in the browser based applications that they use (or want to use).
I understand the desire to block all the iffy JS (adverts, particularly adverts that eat CPU cycles and therefore my battery when mobile, tracking, and so on) and I understand that running noscript or similar plugins is too cumbersome in many opinions, but unless you are paying for the content in some way you can't really expect to demand to control how it is delivered to you.
A thought for reducing tracking and such without blocking code used for page functionality: I'd like to see browsers block 3rd party code as an option (as some do for 3rd party cookies), with a whitelist to enable CDNs (possibly with the major CDNs on the whitelist by default). That would still allow iffy code if it is served from the same site (by design or because it has been hacked) so isn't perfect, but it might be a good compromise.
For example, we can achieve an effect similar to the one shown here using just CSS (no JS) if we’re able to use position:relative on the containing paragraph without breaking anything else in the styling:
HTML:
This is some text with a marginal note. Lorem ipsum dolor sit amet...
CSS: .note-container {
position: relative;
width: 400px;
}
.note {
text-decoration: underline;
}
.note:hover::after {
content: attr(desc);
position: absolute;
top: 0;
left: 440px;
width: 150px;
height: 100%;
border-left: 1px solid black;
padding-left: 9px;
}
I put a quick demo of this one here:https://jsfiddle.net/2ejk2who/
However, what happens if we need to work with touch-only devices, where hover effects aren’t available? Two options would be to show the notes all the time, or to embed a hidden checkbox and make the anchor text its label. In the latter case, tapping on the text could then toggle whether the marginal note appears if we used something based on :checked instead of :hover.
But now what if more than one note is set to visible at once? We can’t combine the position:absolute technique to get neat alignment at the top of the paragraph with using floats so multiple notes automatically fall under one another. I don’t have a good pure-CSS answer for this one.
In any case, on a smaller screen we might not want to show marginal notes alongside the main text anyway. It would be helpful if there were a way to have the notes drop underneath the paragraph and stack up, but again, we can’t combine the kind of absolute positioning that would place a note there with something that extends the paragraph’s box so later content moves down after any visible notes.
Perhaps one day we’ll have more flexible options for generated content and CSS positioning that will let us do these things, but for now the only ways I know to achieve some of these effects still rely on JS.
What happens if I have JavaScript disabled (and I do have)?
> and I do have So you can tell us: what happens if you have Javascript turned off? I have sympathy for the "what happens if I'm using a screen reader or other accessibility device" question, not excluding those who need to use assertive technologies where possible is important. geocar's post below suggests what might be a better implementation in that regard, which will support your use case too, but some advanced s…
And here I try to make some criticism of the posted work, and constructively. I think coding defensively for the noscript case is a good, important practise, even if the chosen remedy is to show up a "please enable JS" message. And then there's the case of printing the page, the read-it-later things, archival, etc... I can't run JS on paper, or on PDFs, right? But the WWW is ephemeral, and if something is important, I have to archive. And people have disablities, how would margin notes be readable with say 5x zoom? How will a disabled person get to read the popup margin note if he can't even move the mouse to hover the anchor tag? One may well say that disabled people are not worthy of seeing their content, and however disgusting may it sound they've the right to say so, but the OP may be open to such suggestions for inclusivity and improvement, and I suggest.
I think the JS CDNs are the most stupid things on the world. It is a virus vector. Hack one CDN, and you'll get to run your code on maybe millions of websites. And who decides which CDNs are major, and/or better or more secure?
Earlier quoted context omitted.
Which is bad if them notes are not ornaments only. So there should be some fallback. I guess a good approach would be to collect the content from some p.marginnote elements which would be hidden if JS is present and left intact if not. So, like GCC ... The GNU Compiler Collection With JS, they'd become margin notes, whithout it, they'd render as plain footnotes.
Why not just: GCC[1] … 1. The GNU Compiler Collection It's compatible with the W3C recommended idiom for footnotes[2], is accessible without JavaScript, and you can still use `.marginnote` to provide CSS styling. [2]: https://www.w3.org/TR/html5/common-idioms.html#footnotes