搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

how do I print the hyperlinks on a Web site. The text itself prints with no problem.

  • 6 个回答
  • 2 人有此问题
  • 9 次查看
  • 最后回复者为 jblavigne

more options

The hyperlink is highlighted and when I right click I get, in this case, an email address, but when I print the document all I get is the highlighted text.

The hyperlink is highlighted and when I right click I get, in this case, an email address, but when I print the document all I get is the highlighted text.

所有回复 (6)

more options

how do I print the hyperlinks on a Web site:

one way would be to modify the code temporarily with a bookmarklet see the "href:" bookmarklet on several of my pages including:

Look for "href:" or "href: visible" and drag it to a bookmark folder, right-click on the bookmark and add href: as the keyword shortcut.

You can then type  href:  into the location bar and the link urls and mailto: links will be shown and can be printed.

If you just want a list of links, then select the entire page ("Ctrl+A") or a smaller selection. Then right-click and choose "Copy links" and paste into a text file or email. If the links are long it may be difficult to read, or impossible if lines don't wrap.


You can test "href:" on the webpage by clicking on the link, and it will show you what it does on that page. If is called a bookmarklet because it can be bookmarked and contains JavaScript code.

由David McRitchie于修改

more options

The Web site is impressive, as is the variety of tools. However, as a new Firefox user, I'm overwhelmed. I found href: HREF visible in your Keyword Shortcuts section and dragged it to my Bookmarks folder (I have only the one and no Personal bars).

But, what do I do next? Tried adding it to a URL and putting it in the address bar when I had a Web site displayed. Neither worked to allow the hyperlink to be printed. There's probably a simple step or two I missed. Pleas give detailed instructions to this newbie. Thanks.

more options

You can use a bookmarklet like this to inject the URL after a link via a stylesheet.

javascript:(function(){var SS,nSS,D=document;SS='data:text/css, a[href]:link:after,a[href]:visited:after{content:" «"attr(href)"» ";font-size:75%}';{nSS=D.createElement('LINK');nSS.setAttribute('rel','stylesheet');nSS.setAttribute('type','text/css');nSS.setAttribute('href',SS);D.documentElement.childNodes[0].appendChild(nSS);}})();

You can remove the stylesheet with this bookmarklet:

javascript:(function(){var e=document.getElementsByTagName('LINK'),i;for(i=0;E=e[i];i++){if((E.rel=='stylesheet')&&(/^data:/.test(E.href))){E.parentNode.removeChild(E);}}})();

由cor-el于修改

more options

You have the "href:" bookmarklet that you dragged to the toolbar.

Open the page you wanted to see with the links, then click on the bookmarklet, the link urls and mailto: will appear to the right of the links on the page.

You can print what you see.

I had said you could click on the bookmarklet on the kws.htm page and see how it works.

more options

That href: bookmarklet is broken (it ends prematurely):

javascript:(function(){ var z=[],N,href,tc,j; function r(N) { if (N.href) z.push(N); var C=N.childNodes,i;for(i=0;i<C.length;++i)r(C[i]); } r(document.body); for (j in z) { N=z[j]; href=document.createTextNode( [--%C2%A0%22+N.href+%22 --]%22); tc=document.createElement(%22span%22); tc.style.color=%22green%22; tc.style.background=%22

It is not the only one on that page, so you need to check all 34 of them.
A few look like this (seem to have problems a long time ago with the '<'):

javascript:(function(){%20var%20z=[],N,href,tc,j;%20function%20r(N)%20{%20if%20(N.href)%20z.push(N);%20var%20C=N.childNodes,i;for(i=0;i

It is much better to do such things via a stylesheet than modifying the page source (DOM).
If really needed then add a class name to elements.

由cor-el于修改

more options

Hopefully, dmcritchie can post a complete href: bookmarklet. Thanks, cor-el.