Křištof Želechovski schreef:
href="print://www.whatwg.org/specs/web-apps/current-work/" is no good;
it asks the browser to find the resource using the print protocol.
But the print protocol is for printing, not for finding resources; I
imagine it could be used for finding out some printer configuration
parameters (similar to the way printers with a network interface only
can be configured) and to submit documents for printing, nothing more.
How about
<form
action="print://host_name/printer_name/?
href=&quo;http://www.whatwg.org/specs/web-apps/current-work/&quo;&
palette=mono&
copies=3&
mode=draft,booklet&
stapled=top" method="post" ><input type="submit" value="Print
me"></form >? It feels better to me. Of course, the arguments would
be interpreted by the browser, not by the printer, contrary to what
the syntax suggests, but I think this problem is much smaller and I
can swallow it in spite of being a purist.
The idea was not to dictate from HTML how the printer should behave
(number of copies, color, etc.). This should be up to the visitor, who
can manage that in the print prompt. The request was about an
alternative to javascript:print() where there would be no need for
client-side scripting.
I probably gave this discussion a wrong turn by saying that a
print-pseudo-protocol would perhaps be a good solution. I guess i should
not have done so as my knowledge about such things is minimal.
The idea that a fragment can address a block element is quite
interesting; in the old days a reference to #name would usually
correspond to an anchor with the same name---and you cannot embrace a
block-level element with an anchor. I think it is still common
practice to put the named anchor around the section header and not
around the whole section, which would require a division, not an anchor.
I wasn't talking about an anchor, but about an id, which can be any kind
of element, with any kind of content. This is how bookmarks work
nowadays and it is quite similar to CSS id-selectors. As this "fragment
printing" would be new I don't see any backwards compatibility issues.
I did not want to say that printing is obsolete; I wanted to say that
asking the customer to print is obsolete. Sorry for the
misunderstanding. Your site should not lose functionality because
your customer does not have a printer.
It would be the same as it is now. Even with unobtrusive JavaScript I
can not check whether a printer is installed and connected.
cheers,
Sander