Recent Web Log Entries By Ben Nadel

ColdFusion 8's OnMissingTemplate() - So Close To Being Good

Posted: July 1, 2009 at 10:23 AM by Ben Nadel

Tags: ColdFusion

When ColdFusion 8 came out, I never really paid any attention to Application.cfc's new OnMissingTemplate() event handler. This method allows you to handle 404 errors at the application level rather than the server level. At a glance, it seems like an awesome new feature until you realize that it has one glaring issue: it only works for non-existin... read more »

Comments (13)  |  Post Comment  |  Ask Ben  |  Permalink



Ask Ben: Overriding Core jQuery Methods

Posted: June 30, 2009 at 2:06 PM by Ben Nadel

Tags: Ask Ben, Javascript / DHTML

Is there a way to overload the included remove() function in jquery? Possibly a separate js file? For example we are using the min version and it would be cool to not have to add this in each time we upgraded to a new version that has come out? jQuery is such a well thought out, powerful Javascript library, that it actually uses itself to build i... read more »

Comments (3)  |  Post Comment  |  Ask Ben  |  Permalink


Ask Ben: Detecting When DOM Elements Have Been Removed With jQuery

Posted: June 30, 2009 at 10:11 AM by Ben Nadel

Tags: Ask Ben, Javascript / DHTML

I know that jQuery is great for event management, but I was wondering if you have come across a way to detect if a DOM element (say a row in a table) was removed? I have a table and I want to run an ajax request every time a tr was removed, but there are several ways that the tr could be removed. If you look at the W3C, there is actually an event... read more »

Comments (7)  |  Post Comment  |  Ask Ben  |  Permalink



Thirty Years Of Pain: A History Of The World's Strongest Man DVD

Posted: June 26, 2009 at 9:49 AM by Ben Nadel

Tags: Health / Fitness

I just finished watching Thirty Years of Pain: A History Of The World's Strongest Man . It's a two-part documentary about the World's Strongest Man competition. The first part, Thirty Years of Pain, takes us on a journey through the entire history of the WSM competition, from the first event at Universal Studios right up to the 2008 finals in Cha... read more »

Comments (5)  |  Post Comment  |  Ask Ben  |  Permalink


Ask Ben: Formatting A Date Span In ColdFusion

Posted: June 25, 2009 at 9:28 AM by Ben Nadel

Tags: Ask Ben, ColdFusion

I'm new to CF. I have values for startDate and endDate. Let's say my startDate is June 12, 2009 and my endDate is June 30, 2009. How do I display it to look like 'June 12-30, 2009'. And if the months are different for startDate and endDate, how do I display 'June 12 - December 12, 2009'. Thank you for your help. In ColdFusion, there's no inherent... read more »

Comments (12)  |  Post Comment  |  Ask Ben  |  Permalink


Strong: The Movie - A Documentary About Joe DeFranco's Gym

Posted: June 24, 2009 at 10:51 AM by Ben Nadel

Tags: Health / Fitness

When I saw the trailer for "Strong: The Movie" by Joe DeFranco , I didn't really know what it was about, but I know that it looked like it kicked ass; the trailer had big guys lifting heavy stuff with bands and chains and 600lb tires all set to a bitchy remix of Daft Punk's, "Harder Better Faster Stronger." In short, the trailer made me want to s... read more »

Comments (4)  |  Post Comment  |  Ask Ben  |  Permalink


Caching ColdFusion Pages With Expires Header Value

Posted: June 24, 2009 at 9:46 AM by Ben Nadel

Tags: ColdFusion

A while back on this blog, I talked about taking ColdFusion date/time stamps and converting them to Greenwich Mean Time and then to HTTP time strings . I had mentioned that I was doing this because I was dealing with HTTP headers which required HTTP time strings; but, I never really got into then, so I figured I would talk a bit about it now. At ... read more »

Comments (10)  |  Post Comment  |  Ask Ben  |  Permalink


Ask Ben: Converting Javascript Variables Into ColdFusion Variables

Posted: June 22, 2009 at 9:51 AM by Ben Nadel

Tags: Ask Ben, ColdFusion, Javascript / DHTML

How can I convert a JavaScript variable into a coldfusion variable? I have been asked this question enough times that I figured it was be time to turn it into an actual Ask Ben blog post for future reference. Often times, when front-end developers start getting into server-side scripting (hopefully using ColdFusion), there is some confusion as to... read more »

Comments (5)  |  Post Comment  |  Ask Ben  |  Permalink


Voiding Click Events Implicitly With jQuery Plugin: voidClick()

Posted: June 19, 2009 at 2:55 PM by Ben Nadel

Tags: Javascript / DHTML

When binding an event handler to a click event using jQuery, I'd have to say that 99.99% of the time, I want to cancel the default click event and route all handling through my event binding. Because of this, I've gotten very tired of the repetitive nature of always returning false in my event handlers: $( selector ).click( function( objEvent ... read more »

Comments (4)  |  Post Comment  |  Ask Ben  |  Permalink


Scripts Tags Get Moved Only During Window DOM Node HTML Injection

Posted: June 19, 2009 at 10:17 AM by Ben Nadel

Tags: Javascript / DHTML

Last week, I posted that performing HTML-based AJAX with jQuery moves Script tags around when injecting HTML into the DOM . At the time, it was unknown to me as to when this tag movement actually took place - when the raw HTML got parsed or when it was injected into the current document object model (DOM). After some further experimentation, it b... read more »

Comments (8)  |  Post Comment  |  Ask Ben  |  Permalink


ColdFusion CreateTimeSpan() And CFLoop (via Ray Camden)

Posted: June 18, 2009 at 2:29 PM by Ben Nadel

Tags: ColdFusion

I was just reading over on Ray Camden's blog about a user-submitted issue with the CFLoop behavior using times and a CreateTimeSpan()-based increment . Here is code equivalent to what Ray's reader submitted: <!--- Create 5 minute interval step. ---> <cfset dtStep = CreateTimeSpan( 0, 0, 5, 0 ) /> <!--- Go from 9 AM to 10... read more »

Comments (2)  |  Post Comment  |  Ask Ben  |  Permalink


Why My Queries Hate Application Service Layers

Posted: June 18, 2009 at 10:02 AM by Ben Nadel

Tags: ColdFusion, SQL

Last week, I was trying to take an old, procedural style ColdFusion application and factor out queries into some sort of Service layer. I wasn't trying to create an Object Oriented ColdFusion application - I was merely trying to centralize some business logic such that it wasn't so distributed throughout the application. At a glance, this seems li... read more »

Comments (63)  |  Post Comment  |  Ask Ben  |  Permalink


ColdFusion Tag Parameters Can Be Included In Separate Files (Thanks Mark Drew!)

Posted: June 17, 2009 at 9:06 AM by Ben Nadel

Tags: ColdFusion

At the New York ColdFusion User Group a few weeks ago, Mark Drew was presenting on Reactor, an ORM framework . In his presentation, he was discussing how the SQL was generated and he had something on a slide that I don't think I had ever seen before. He had a CFQuery tag in which the SQL was defined in an included file (via CFInclude). Now, I'v... read more »

Comments (15)  |  Post Comment  |  Ask Ben  |  Permalink


AxisFault: ColdFusion Web Services And XML Data Types

Posted: June 15, 2009 at 10:23 AM by Ben Nadel

Tags: ColdFusion

A little while ago, I was helping someone debug a ColdFusion, SOAP-Based, web service error. Web services in general are not easy to debug and the problem was not too obvious, so I thought I'd post it here. To narrow down the problem, I set up a sample web service with just enough logic to duplicate the error. Here is the remote ColdFusion compone... read more »

Comments (9)  |  Post Comment  |  Ask Ben  |  Permalink


Preventing Default Actions In A Bubbled Event In jQuery

Posted: June 12, 2009 at 3:07 PM by Ben Nadel

Tags: Javascript / DHTML

I was just reading over on Jon Hartmann's blog about leveraging event bubbling in jQuery . It's a very cool concept and one that I have not played around with enough so far. When I was reading his post, however, I immediately wondered if default actions could be prevented using this technique. For example, if I have links within a list and the cl... read more »

Comments (8)  |  Post Comment  |  Ask Ben  |  Permalink

July 2009 Entries »

Previously Posted

A Problem With My Coding Methodology That's Driving Me Crazy - Posted Jun 12, 2009
Ben Forta At The NYCFUG: ColdFusion Centaur, Bolt, And Flash Tour - Posted Jun 11, 2009
ColdFusion 8 Application Specific Mappings Work With The CFComponent Extends Attribute - Posted Jun 11, 2009
Project HUGE: Huge In A Hurry - Get Big - Phase 2 / Week 3 - Posted Jun 10, 2009
Ask Ben: Dynamic Form Field Population With jQuery - Posted Jun 10, 2009
jQuery AJAX Strips Script Tags And Inserts Them After Parent-Most Elements - Posted Jun 9, 2009
Using Script Tags As Data Contains In AJAX-Powered jQuery - Posted Jun 8, 2009
jQuery And Script Tags As Data Containers - Posted Jun 5, 2009
GetHTTPRequestData() Breaks The SOAP Request / Response Cycle In ColdFusion - Posted Jun 5, 2009
SOAP Web Service Errors Are Handled Externally To The ColdFusion Application Framework - Posted Jun 4, 2009
Project HUGE: Huge In A Hurry - Get Big - Phase 2 / Week 2 - Posted Jun 2, 2009
Campaign Monitor API Connection Failure With CFHTTP And GZIP Compression - Posted Jun 2, 2009
June 1st 2009 - 2nd Annual (Inter)?National Regular Expression Day! - Posted Jun 1, 2009
Contextual CSS Is Good When You Know Everything About Your Content - Posted May 27, 2009
Converting To And From GMT / UTC Time In ColdFusion Using DateConvert() - Posted May 27, 2009
Converting To GMT And From GMT In ColdFusion For Use With HTTP Time Stamps - Posted May 26, 2009
My Journey Through cf.Objective() 2009 (And My Raffle Winner!) - Posted May 22, 2009
Ask Ben: Collecting And Relating Sibling XML Nodes In A ColdFusion XML Document - Posted May 22, 2009
Getting IFRAME Window (And Then Document) References With contentWindow - Posted May 22, 2009
Ask Ben: Print Part Of A Web Page With jQuery - Posted May 21, 2009
Converting XHTML To Text-Only Version Using ColdFusion And XSLT - Posted May 20, 2009
Date Addition Using CreateTimeSpan() Creates A Numeric Date - Posted May 19, 2009
Do Remote CFC Method Calls Add Any Value In ColdFusion? - Posted May 18, 2009
CFM Templates And Remote CFCs - They're All Just ColdFusion Page Requests - Posted May 18, 2009
cf.Objective() Photo Raffle With Me (Ben Nadel) - Posted May 12, 2009
The New BenNadel.com - Same Content, Fresh New Look - Posted May 10, 2009
Preventing Form Caching With Javascript And jQuery - Posted May 8, 2009
ColdFusion 8 Per-Application Settings Get Partially Cached (And There's Nothing You Can Do About It) - Posted May 6, 2009
Ask Ben: Selecting XML Nodes That Have A Given Parent Node Using XPath - Posted May 5, 2009
Data-Driven CSS Style Sheets Using ColdFusion - Posted May 5, 2009
Ask Ben: Executing ColdFusion Custom Tag Code If First Run Only - Posted May 4, 2009
Paraming ColdFusion XML Documents With CFParam (Part II) - Posted May 4, 2009
Paraming ColdFusion XML Documents With CFParam - Posted May 4, 2009
Thoughts On User / Page Request Security Model (Part II) - Posted May 1, 2009
Thoughts On User / Page Request Security Model - Posted Apr 30, 2009
Using The OnError() Event Handler Implies A "200 OK" Response Status Code - Posted Apr 29, 2009
Ask Ben: Manually Enforcing Basic HTTP Authorization In ColdFusion - Posted Apr 28, 2009
Changing The Root Node In A ColdFusion XML Document Using XSLT - Posted Apr 24, 2009
Ask Ben: Pulling Unique SQL Records That Match ALL Join Conditions - Posted Apr 23, 2009
Randomly Executing 1..N Nested ColdFusion Custom Tags - Posted Apr 23, 2009

Recent Blog Comments
Sam
Jul 2, 2009 at 7:10 PM
ColdFusion CFInvoke Eliminates The Need For Evaluate() When Dynamically Executing User Defined Functions
HI Ben, I have an issue using ajax. Hope you can answer it with ease..... I am trying to fill a div tag dynamically when the page loads from an external file (may be .cfm or .htm) There is som ... read »
Jul 2, 2009 at 6:22 PM
Defaulting To The Numeric Keyboard On The iPhone
This is actually Gareth not Ben :) Can you try using some JavaScript? Will that still get caught by the bookmark screen cap? ... read »
Jul 2, 2009 at 6:13 PM
jQuery Data() Method Associates Data With DOM Elements - SWEET ASS SWEET!
Thanks for your quick reply and explanation Andy :-) Hmm, cool, haven't realized that you could actually also create NeW jQuery objects like this. Think I have to play around with it to fully underst ... read »
Jul 2, 2009 at 6:09 PM
ColdFusion 8's OnMissingTemplate() - So Close To Being Good
ColdFusion in the standard install won't do this, because the web server isn't passing the requests into CF. In Apache, the filetypes sent to CF are defined by the config line: AddHandler jrun-handl ... read »
dvo
Jul 2, 2009 at 6:05 PM
Defaulting To The Numeric Keyboard On The iPhone
@ Ben hmmm... Well, to get the homescreen webapp going, a user has to manually add it to the homescreen by going to the site in safari mobile and pressing the + icon and then "Add to Home Screen", ... read »
Jordan
Jul 2, 2009 at 5:56 PM
Ask Ben: Parsing CSV Strings With Javascript Exec() Regular Expression Command
This works: var classList = loadFile("/KC/data/classes.csv"); var classes = CSVToArray( classList , "," ); function loadFile(url) { var req = false; // branch for native XMLHttpRequest object ... read »
Jordan
Jul 2, 2009 at 5:42 PM
Ask Ben: Parsing CSV Strings With Javascript Exec() Regular Expression Command
How would I use this on an actual .CSV file? ... read »
Jul 2, 2009 at 5:39 PM
Defaulting To The Numeric Keyboard On The iPhone
Why not just have a different URL for the homescreen app vs. the landing page for the mobile app? www.myappleapp.com/index.cfm then www.myappleapp.com/index.cfm?fromHomeScreen=1 or www.myappleapp.co ... read »