On 1/4/06, <b class="gmail_sendername">Patrick Barnes</b> <<a href="mailto:nman64@n-man.com">nman64@n-man.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Arthur Pemberton wrote:<br>><br>><br>><br>> Great. One problem I have not yet found a solution to however is the<br>> handling of the TARGET attribute (not supported in XHTML). Altough I<br>> am some time away from coming to this problem. Any suggestions on how
<br>> to handle that?<br>><br>><br>You have three choices, and I'll leave the choice up to you.<br><br>1. Extend the DTD to include the target attribute.<br>This will allow the document to validate, but really is cheating.
<br><br>2. Use JavaScript with PrivoxyWindowOpen().<br>Works well, but can cause problems with the passing of the referring URL<br>or with old browsers.<br><br>3. Use JavaScript and the rel attribute to set the DOM target attribute.
<br>This JavaScript (probably in a separate .js file):<br><br>|function externalLinks() {<br> if (!document.getElementsByTagName) return;<br> var anchors = document.getElementsByTagName("a");<br> for (var i=0; i<
anchors.length; i++) {<br>   var anchor = anchors[i];<br>   if (anchor.getAttribute("href") &&<br>       anchor.getAttribute("rel") == "external")<br>     anchor.target = "_blank";
<br> }<br>}<br>window.onload = externalLinks;<br><br>This script tag:<br><script type="text/javascript" src="filename.js"> </script><br>|<br>And anchors that look like this:<br><a href="
<a href="http://target.uri.here/">http://target.uri.here/</a>" rel="external">A Link to open in a new<br>window</a><br><br>This solution is probably the one I would use.  It works well throughout<br>
the browser world (ancient browsers will open the links in the same<br>window), and it complies with standards without cheating.</blockquote><div><br>I hadn't come across 3 before. I like it the best. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
--<br>Fedora-websites-list mailing list<br><a href="mailto:Fedora-websites-list@redhat.com">Fedora-websites-list@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/fedora-websites-list">https://www.redhat.com/mailman/listinfo/fedora-websites-list
</a><br><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>As a boy I jumped through Windows, as a man I play with Penguins.