A LIST Apart: For People Who Make Websites

No. 203

Discuss: Improving Link Display for Print

Pages

 <  1 2 3 4 >  Last »

11 Great article! But why onload=?

Hi! A great article. But wouldn’t
window.onload = function() { footnoteLinks(‘container’,‘container’);
}
make all previous onload-added functions be erased? I would have suggested Scott Andrew’s addEvent function, but I recently read about some flaws of that method at http://www.quirksmode.org/blog/archives/2005/08/addevent_consid.html – have a look at http://www.quirksmode.org/blog/archives/2005/09/addevent_recodi.html for some alternate ways instead.

On the “Print Preview” matter… I wonder if that wouldn’t be “lying to the visitor” in a way: maybe she has made some customisations in the browser that makes the prints different; for example told the browser to exclude background pictures, colors or whatever on print-out. Would a “Print Preview” be able to adapt to that?

posted at 12:03 pm on September 20, 2005 by Pär Axelsson

12 Print Preview

_ “…told the browser to exclude background pictures, colors or whatever on print-out. Would a “Print Previewâ€? be able to adapt to that?”_

The typical modern browser comes with a Print Preview that does most of what you say. Why duplicate that?

I would like to see the article’s effect working on the screen version though. It’s just to good to hide! However, I’m not digging the superscripted numbers. What happens if they follow text that is already superscripted? Ie: the squared part at the end of Einstein’s famous formula.

I’ve seen print use square brackets around numbers after important words, so I would prefer that. Eg:

Visit Meyerweb.com1

The problem there lies in that the HTML list at the end uses numbers and periods, which doesn’t match the above format. Perhaps generated content could come to the rescue?

posted at 01:17 pm on September 20, 2005 by Chris Hester

13 Ooops...

A List Apart changed my example! It should have had square brackets around the 1 after the link. (Well it looked OK on preview…)

posted at 01:20 pm on September 20, 2005 by Chris Hester

14 Untitled

Chris: [em]“Why duplicate that?”[/em] Yep, that was exactly my point. I’m sorry if my language skills didn’t allow me to make that clear. :)

posted at 01:31 pm on September 20, 2005 by Pär Axelsson

15 What if you have footnotes already?

This is seriously great. But what if your document already has footnotes? Maybe an alternate numbering system, such as the links as a,b,c and your regular footnotes as 1,2,3?

Or perhaps a more complex solution that will automatically renumber your existing footnotes and correctly intersperse the links?

posted at 01:59 pm on September 20, 2005 by Nerkles F.

16 Why onload?

(to Pär Axelsson): you can call as many functions one after another, as you want, if you do it this way:
window.onload = function() {
functionOne();
functionTwo();
functionThree();
}
make sure, there is no “onload” call from the “body” tag, though.

posted at 03:11 pm on September 20, 2005 by Ilya Gerasimenko

17 Re: Why onload?

Ilya: Yes, but that wouldn’t be very modular. What if I include two different scripts, each with their own set of functions that should be “onloaded” (or onclicked, or whatever).

A working cross-browser addEvent()-function would be great to have, why I’m waiting for the “recoding competition” at http://www.quirksmode.org/blog/archives/2005/09/addevent_recodi.html to be finished…

Btw how do I include a link in the comments?

posted at 04:01 pm on September 20, 2005 by Pär Axelsson

18 Minor Issue: Cut and Paste

We did this on our site about 8 months ago and have found it to be very useful. In addition to not having footnotes for navigation links, we also added some code to check if the text of the link was the url itself. If the url was already displayed, then there’s no need to have a footnote.

Minor bug: When you cut and paste from a page using this script, the footnotes carry over, even though they didn’t show up on the screen version of the page. Haven’t figured out a workaround for this (if there is one). Any thoughts?

posted at 04:24 pm on September 20, 2005 by Justin Spargur

19 Even simpler with Associative Arrays

The following code can be used to replace the duplicate-checking part of the code and avoid the use of a couple of the jsUtilities functions, including inArray, which I imagine isn’t nearly as efficient for large lists as associative arras are. Plus you can avoid that confusing bit with the === operator.

if (myArr[thisLink]) { // if a duplicate // get the corresponding number from // the array of used links note_txt = document.createTextNode(myArr[thisLink]); } else { // if not a duplicate var li = document.createElement(‘li’); var li_txt = document.createTextNode(thisLink); li.appendChild(li_txt); ol.appendChild(li); myArr[thisLink] = num; note_txt = document.createTextNode(num); num++; }

posted at 05:43 pm on September 20, 2005 by Brian Hardy

20 Excellent Article

Nice to see a truly useful article at ALA for a change (i.e. not so cutting edge that we can apply it in our day-to-day work).

I’d love to see a follow up that incorporates some of the great suggestions that have been made in the comments.

posted at 05:48 pm on September 20, 2005 by Christian Watson

Pages

 <  1 2 3 4 >  Last »

Discussion Closed

New comments are not being accepted, but you are welcome to explore what people said before we closed the door.

Got something to say?

Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.

Create a new account or sign in below if you’d like to leave a comment.

Remember me

Forgot your password?

Subscribe to this article's comments: RSS (what’s this?)