SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Feb 11, 2005, 15:10 #1
- Join Date
- Sep 2004
- Location
- usa
- Posts
- 141
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
converting links to URL/URIs when printing
does anyone know of a script that automatically converts inline text links to the actual URL when the documented is printed?
thank you :-)
-
Feb 11, 2005, 15:18 #2
CSS does the trick for non-IE browsers.
Code:a:after { content: attr(href); }
Code://caution: code is untested onbeforeprint = function () { var links = document.getElementsByTagName("a"); var i = 0, thislink; while (thislink = links[i++]) { var tn = document.createTextNode(thislink.getAttribute("href")); thislink.appendChild(tn); } }
-
Feb 14, 2005, 09:30 #3
- Join Date
- Sep 2004
- Location
- usa
- Posts
- 141
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks vinnie, but i'm afraid that is a bit over my head. and wouldn't that display them onscreen as well?
as a guess, though, could i do it as onprint rather than onbeforeprint so they would dipslay as normal links onscreen and i would not have to have the afterprint code?
-
Feb 14, 2005, 15:35 #4
Originally Posted by mtouchette
HTML Code:<style type="text/css" media="print"> <!-- a:after { content: attr(href); } --> </style>
as a guess, though, could i do it as onprint rather than onbeforeprint so they would dipslay as normal links onscreen and i would not have to have the afterprint code?
Bookmarks