Another iPad Giveaway
| July 22nd, 2010 | Comments Off | Uncategorized
I ran across an iPad giveaway today on Where Does All My Money Go. I really hope I win this time… seeing as I didn’t win last time
Brian Lang, Abbotsford, BC, Canada
My observations of the world and news from my life
| July 22nd, 2010 | Comments Off | Uncategorized
I ran across an iPad giveaway today on Where Does All My Money Go. I really hope I win this time… seeing as I didn’t win last time
| May 26th, 2010 | Comments Off | Uncategorized
I ran across an iPad giveaway today on Where Does All My Money Go. I really hope I win!
Now to start reading more of the blog to see if it’s worth adding to Google Reader or not…
| October 20th, 2009 | Comments Off | Uncategorized
Raymond Camden posted an article this morning on displaying an alert to the user when you click a link that would leave/exit the website. In his example, he suggests adding an extra class to the links that require this feature. In my experience this kind of pop-up confirmation alert when clicking the link is often used by old-school, monolithic institutions or government agencies. But, if you really want or need to annoy your users, here’s a different way to do it that would work on ALL external links from your web page.
First, make sure you’re using relative or absolute paths for your internal links (instead of fully qualified urls). This technique won’t work if you code every link on your site with the http:// in the href attribute.
Next, make sure you’re including the JQuery library on your page.
Then in a <script>, use the following function to target your external links:
$(document).ready(function () {
$('a[href^="http"]').click(function() {
return confirm("Are you sure you want to do this?")
}
});
Here we’re using a JQuery selector to target external links with this by looking for every instance of “http” in the href attribute of an anchor tag.
This way you do NOT have to add unnecessary, non-semantic code to target external links.
Alternately, if you HAVE coded your links with fully qualified urls, you can substitute the JQuery selector I used above with this one:
$('a[href^=http]:not("[href*=://' + document.domain + ']")');