Note: This site might seem inactive… That’s because it is. Don’t worry though, I’m still coding webpages and stuff! If you’re interested, I suggest you get a translator and head over to Qiwi; or you could just check the latest site we’ve been working on: Apotheek Goethals – Debrabandere. Enjoy!
Fitts’ Law Favelet
The not so off-topic commentary on Indranil’s Hyperlinks Over the Ages inspired me into making this favelet. Shout it out: Paul! I think I’m not the only one who sometimes desperately wants to see how a page would look with a little Fitts’ Law applied to body text links. My preferation goes out to padding: 2px 1px 1px;, which works pretty good for most sites; Herr Mientjes however seems to prefer padding: 4px 0;. Enjoy.
Comments (8)
Listed below are the responses for this entry.
Hey, I know this shit!
However…
Error: uncaught exception: [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location: "javascript:(function(){var css;css=document.createElement('link');css.rel='stylesheet';css.type='text/css';css.href='data:text/css,a,a:link{padding:4px 0;}';document.documentElement.childNodes[0].appendChild(css);})(); Line: 1"]Maybe it doesn’t work? ;)
Oh wait.
It just won’t work on your site.
Nice one. Works nicely on my site.
That’s so weird… It works everywhere except on my own site!
You get this Javascript exception because your site is using the correct
content-typeheader (i.e.application/xhtml+xml); it works fine ontext/htmlpages though. This probably has something to do with the sort of code you insert.I stumbled upon this page when looking for a replacement for writing HTML into a document using the DOM, as
.innerHTMLdoesn’t work. One of the methods I used throws the exact error.The error is coming from the
appendChildmethod, but I don’t know the solution unfortunately.I think it won’t work here because you’re serving your pages up as
application/xhtml+xml. You need to check fordocument.createElementNSand use that if it exists, else usedocument.createElement.Thanks for the info, Vincent and Aankhen. I of course forgot about the
document.createElementNSmadness, which can be fixed by using the thecreateElement()function. The favelets are now fixed, and should work in all circumstances.I don’t think that’s the problem. I haven’t looked at your code, but I assume you are doing something like
document.insertBefore(foo, bar). If you instead dobar.parentNode.insertBefore(foo, bar), it should work.