<a href="#" onClick="ColdFusion.Window.create('etc', 'etc.cfm');">The upshot to this technique is that you get a link that looks and acts like a link. The minus is that when you click it, it appends a hash mark (#) to the end of your url. Not a big deal, but still.
On Friday, at the fabulous Salt Lake RIA Dev Shed, I learned another little "duh" JavaScript technique. Rather than trying to explain it, I will just show. You can do the same thing as the above like this:
<a href="javascript:ColdFusion.Window.create('etc', 'etc.cfm';">
Huzzah for cheap little JavaScript tricks!
1 comment:
It'd be better to append 'return false' on your onclick attribute. You could even then use a normal link in the href attribute, if you wanted to provide an alternative that would work for anyone with javascript disabled. The return false prevents the browser going there in the first place, if the javascript is enabled (you probably already know all this, just spelling it out for the benefit of others)
Post a Comment