Entries for month: “April 2010”
Open links in a new window
If you perform a search for "open links in new window" you will typically find two groups of people. Ones the hate it when links open in a new window, and ones that hate links that don't open in a new window. It seems that people are pretty picky (and vocal) about the manor in which links open. Oddly enough searching for a good solution proved more difficult than I thought.
Basic Criteria
Because people are so particular about their links opening in new windows. I wanted to give users an option to open linked pages they way they want them to work. A preference toggle of sorts. I also wanted to default option to xhtml valid and it has to be accessible in it's default state or with javascript turned off.
Thanks to a friend and fellow web developer Andy Ford, who helped me with the final piece of the puzzle to make this work.
The Code
The code is pretty straight forward. We have a form with a checkbox with with text that reads something like "Open links in new window" This works as the preference toggle. If the box is checked do some dirty and non valid stuff to the code to make it work.
See a demo of this script here
<form name="targeter">
<input type="checkbox" name="targetbox" id="tcheck" onclick="targetLinks(this.checked);">
<label for="tcheck" style="cursor: hand;">Open links in new window</label>
</form>
<script language="JavaScript">
function targetLinks(boNew) {
if (boNew)
where = "_blank";
else
where = "_self";
for (var i=0; i<=(document.links.length-1); i++) {
document.links[i].target = where;
}
}
</script>
I thought this was a bit easier to implement than most of the solution I found out there that required you to add a new class to the link. Some people suggested using rel="external" on the links. My response to this is simple. Not all links that need to open in a new window are external. Adding rel="external" is not semantic so I would prefer not to add that markup to my code in that way.
I am sure there is a better way to make this work. But this is what I scabbed together. If you have a better way, I would be interested in knowing about it.
→ Respond NowTags: Code · usability
Who Uses ColdFusion Anymore?
I went to a web development meeting a few days ago and when I mentioned during the introductions that I was a ColdFusion developer the reaction from others in the room was that of amazement. I think they were amazed that the language still existed. I'm not surprised really. It's actually a common reaction from developers.
Someone in the room asked, "Does anyone even use ColdFusion anymore?" I know that I see ColdFusion powered sites all the time, but for the life of me I could not recall a single site that used it other than MySpace. And honestly, that's not a shining example of a good CF site. Feeling a bit embarrassed that I could not recall some decent sites on the spot, I felt I needed to do a bit of research and compile a list ColdFusion powered sites. If for no other reason that to answer this simple question when asked.
So here is a list more popular sites that I know to run ColdFusion. If your wanting to find a more comprehensive list, GotCFM.com has a pretty large database of sites.
- AT&T (portions)
- Bank of America (portions)
- Boeing (portions)
- California Department of Toxic Substance Control
- California Department of Water Resources
- California Dept of Developmental Services
- CarFax
- Dallas Cowboys
- Doctors Without Borders
- Duke University
- eBags
- Ebay (portions)
- Energy Star
- Foot Locker
- Gamepro
- Georgia Tech Savannah
- Guitar Center
- Hasbro Toys
- HP (portions)
- Logitech
- Macworld UK
- Massey University
- Merrill Lynch (portions)
- MMORPG
- MySpace
- NASA (portions)
- Ohio University
- Pottery Barn
- QuickBooks Online
- Scientific American
- Section 508
- See's Candy
- The Economist
- U.S. Bank
- Ultimate Fighting Championship
- University Of Amsterdam UVA
- University of Maryland
- US Dept of State
- Virginia College
- Vodafone
→ Respond NowTags: ColdFusion · Opinions & Rants