Re: Fedora Art gallery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/4/06, Patrick Barnes <nman64@xxxxxxxxx> wrote:
Arthur Pemberton wrote:
>
>
>
> Great. One problem I have not yet found a solution to however is the
> handling of the TARGET attribute (not supported in XHTML). Altough I
> am some time away from coming to this problem. Any suggestions on how
> to handle that?
>
>
You have three choices, and I'll leave the choice up to you.

1. Extend the DTD to include the target attribute.
This will allow the document to validate, but really is cheating.

2. Use _javascript_ with PrivoxyWindowOpen().
Works well, but can cause problems with the passing of the referring URL
or with old browsers.

3. Use _javascript_ and the rel attribute to set the DOM target attribute.
This _javascript_ (probably in a separate .js file):

|function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i< anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
}
}
window.>
This script tag:
<script type="text/_javascript_" src="" </script>
|
And anchors that look like this:
<a href="" http://target.uri.here/" rel="external">A Link to open in a new
window</a>

This solution is probably the one I would use.  It works well throughout
the browser world (ancient browsers will open the links in the same
window), and it complies with standards without cheating.

I hadn't come across 3 before. I like it the best.

--
Fedora-websites-list mailing list
Fedora-websites-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-websites-list






--
As a boy I jumped through Windows, as a man I play with Penguins.

[Index of Archives]     [Fedora Users]     [Linux ARM]     [ARM Kernel]     [Older Fedora Users]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

  Powered by Linux