Shaun Mccran

My digital playground

21
S
E
P
2010

Simple JQuery method of intercepting a hyperlink

Ever wanted to run a custom routine (like validation) on a template when a user clicks a link to proceed to the next step? I recently worked on a checkout template that was not a form, but still needed some validation installed when a user clicked the 'proceed' option. The code below shows a very simple way of using a JQuery selector to intercept the href click event and replace it with a custom function. My example shows a 'warning' div, and then returns false, IE does not action the click URL request.

view plain print about
1<s/cript type="text/javascript">
2$(document).ready(function(){
3$("#element").click(function() {
4// Do some custom validation - show a div
5$(".warning").show();
6
7// disable the click
8return false; });
9});
10</script>
11
12<a href="" id="element">proceed</a>
Normally I'd use the validation JQuery plugin, but in this case this page isn't even a form, its just an overview template.
20
S
E
P
2010

Streaming media to Xbox 360's and PS3's using Twonky Media Suite

I run a windows server 2003 pc at home, server 2003 is a great little web server that can handle multiple roles, including file storage. Unfortunately it is not Upnp (universal Plug and Play) so will not stream media directly to media players like Xbox 360 consoles, and the Playstation 3.

The traditional (and recommended) solution to this is to stream the media through another more modern operating system that has upnp / dnla connections that reside in Windows Media player. This can restrict where you store files on a network, I for one do not want to store media on a desktop machine that I rebuild every 4-6 months.

Another solution to this is to use a software application that acts as a translation layer. There are a few around, but the one I've been testing out recently is the Twonky Media Suite. It installs as a software service, and sits quietly in the background and serves up any media requests that hit it. It also appears on the network as a Upnp device, so it will be found by media players, and consoles.

http://twonkymedia.com/products/twonkymanager/default.aspx

Simply install the trial version, in the setup manager point to your media directories, and then fire up your media player. It will find it and allow you to browse through the different media types, completely bypassing the need for windows media center connections, or operating systems that are a little too old to know about Upnp or dnla.

14
S
E
P
2010

Cookies in ColdFusion - cfcookie or cfset?

Cookies are a platform independent scope, by this I mean that even though we can create and manipulate them in ColdFusion, they are not inherently ColdFusion technology. Cookies are ideal if you want to access data at a browser level, in ANY technology, (cfml, asp, javascript etc), and they are also a good way to store non critical data on a users browser. They basically work by sending their data to the browser instance, to be used as temporary storage.

ColdFusion can create, edit and delete cookies quite easily, but what are the functional differences in how you create them? Is one way better than another?

[ More ]

08
S
E
P
2010

Jquery Rounded Corners Plugin Example - cross browser CSS replacement

A while ago I wrote an article on how to implement CSS3 and Cross browser rounded corner CSS. That article (http://www.mccran.co.uk/index.cfm/2010/7/8/CSS-3-Rounded-Corners-Example) mentions that the CSS3 code has not been adopted as a standard by some browsers (IE - I'm looking at you) but that there are some work around's to it, most of which involve re writing DOM elements using JavaScript.

This article deals with a JQuery plugin that can emulate a totally cross browser CSS3 rounded corners solution.

There is an example of the finished code here: JQuery Rounded Corners example

[ More ]

_UNKNOWNTRANSLATION_ /