Re: Fedora Art gallery

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

 



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.onload = externalLinks;

This script tag:
<script type="text/javascript" src="filename.js"> </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.

-- 
Patrick "The N-Man" Barnes
nman64@xxxxxxxxx

http://www.n-man.com/
-- 
Have I been helpful?  Rate my assistance!  http://rate.affero.net/nman64/


Attachment: signature.asc
Description: OpenPGP digital signature


[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