Ask Ben Web Log Entries

Showing 1 - 15 of 170   < Prev | Next >

Ask Ben: Displaying A Blog Teaser (Showing The First N Words)

Posted: September 23, 2009 at 10:22 AM by Ben Nadel

Tags: Ask Ben, ColdFusion, Javascript / DHTML

Hi Ben, I am writing from London, United Kingdom. How can I display the first 50 words of a blog post as a teaser using some jQuery code snippet? I gotta follow you on twitter. cheers. I know you asked to see this as a jQuery code snippet - and I will get to that - but first, I want to approach this from a ColdFusion view point. I think it makes ... read more »

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



Ask Ben: Parsing Nested Lists With A Single Delimiter In ColdFusion

Posted: September 22, 2009 at 10:17 AM by Ben Nadel

Tags: Ask Ben, ColdFusion

Ben, How would I go about splitting a list into multiple lists? For example I have a list: 07/08/2009|1,573,067.20|8/8/2009|1,563,000.20 This list can be infinite in values but will always contain a date/amount combination. I need to split these into lists of 2 one date/amount lists. Seems like it should be easy enough to do but I think I have b... read more »

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


Ask Ben: Excluding Script Tag Content From The jQuery .text() Method

Posted: September 22, 2009 at 9:26 AM by Ben Nadel

Tags: Ask Ben, Javascript / DHTML

Hi Ben, I have come across an issue with jQuery when using "text().length" and I am hoping that you may be able to help. I have applied a CSS class called hideEmpty to a div. I am then using jQuery text().length to provide the total length of that element, including child nodes, and hiding it if it is low. This works very well in most situations b... read more »

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



Ask Ben: Creating ColdFusion Templates On The Fly

Posted: September 21, 2009 at 9:42 AM by Ben Nadel

Tags: Ask Ben, ColdFusion

Hi Ben, frequent reader, first time writer. I'd be surprised if this hasn't been asked yet, but can't seem to find the answer anywhere. I'm trying to figure out a way to allow an application to build basic Coldfusion pages on the fly. i.e. this is a simple CMS that I'm building for someone, where actual page templates are 10 lines long and have a ... read more »

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


Ask Ben: Updating Columns In An Existing ColdFusion Query Object

Posted: September 14, 2009 at 8:17 AM by Ben Nadel

Tags: Ask Ben, ColdFusion

Hi Ben, I have a question:), Is there a way to update a result set that was generated using QuerySetCell. I have a recordset that gets some null values. After the temporary table has been generated, I want to update the empty strings with 0. Is there a way to update query of queries or tables generated by querySetCell method. Thanks. I'm really g... read more »

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


Ask Ben: Creating A PDF And Attaching It To An Email Using ColdFusion

Posted: September 4, 2009 at 5:39 PM by Ben Nadel

Tags: Ask Ben, ColdFusion

Do you know how to save a cfdocument and then attach it to a cfmail all on submit? This is one of the many tasks that ColdFusion happens to make very easy. We can use the CFDocument tag to generate the PDF and store it in memory; then, we can use the CFMail tag and the CFMailParam tag to attach our generated PDF to the outgoing email. With the re... read more »

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


Ask Ben: Extracting And Resizing A ZIP Archive Full Of Images With Coldfusion

Posted: August 31, 2009 at 10:21 AM by Ben Nadel

Tags: Ask Ben, ColdFusion

Great!... Ok, What I need is to upload a .zip file containing large jpgs (1024X768 max), the form would contain two fields ID and the ZIP file. The ID field is the name of the folder that will be created or overwritten (inside this folder will be two others: "tn" and "lg"), then your imageutils will process the images saving 3 versions: "large" in... read more »

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


Ask Ben: Keeping Close Track Of Who Is Currently Online

Posted: August 27, 2009 at 10:03 AM by Ben Nadel

Tags: Ask Ben, ColdFusion, Javascript / DHTML

Hi Ben, I am trying to attempt to have a "current users online" type of functionality for my company's webportal. I am using a application variable such as "application.useronline" which is a list that contains usernames as they login to my portal. As they sign off or when their session times out, a page runs that flushes all their session variabl... read more »

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


Ask Ben: Getting The Domain Name From The Referer URL

Posted: August 26, 2009 at 9:24 AM by Ben Nadel

Tags: Ask Ben, ColdFusion

Hi Ben Nadel, I want to use regex code to extract only domain name for http referrers, can you please give me clue? thanks. Normally, when we think about the domain name of a URL (which is what the CGI.http_referer value is), we think of the domain name as the part of the URL that comes after the protocol (http://, https://, ftp://, etc.). As suc... read more »

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


Ask Ben: Enforcing An SSL (HTTPS) Connection Based On Request

Posted: July 28, 2009 at 9:24 AM by Ben Nadel

Tags: Ask Ben, ColdFusion

Hey Ben!! I have a question for you that I really need help with. I have developed a website that didn't need to be encrypted. Now I was told that I had to incorporate SSL encryption. The problem is that user have the website http://yoursite.com bookmarked, and now when they come to the website they get a loading error on the website. What I need ... read more »

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


Ask Ben: Dynamic Web Root And Site URL Calculations In Application.cfc

Posted: July 19, 2009 at 2:33 PM by Ben Nadel

Tags: Ask Ben, ColdFusion

I'm new to using Application.cfc. Following Ben Forta's tutorial, I've created one that calls a SiteHeader and a SiteFooter. The header has an image file which displays at the root level of the website, but breaks when you go to folders underneath that. I can make it work by setting a Request.Image_Path in Application.cfc, but only by hardcoding t... read more »

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


Ask Ben: CFImage And Dynamic Image Compression With File Size Limits

Posted: July 10, 2009 at 9:19 PM by Ben Nadel

Tags: Ask Ben, ColdFusion

Thanks so much! Still wish there was a function that would get the image's quality to see whether it needs to be reduced or not. Apparently, the way the quality attribute works is that if set at say .8, it reduces the existing quality by 20%. If user has already reduced quality before uploading, then setting quality to .8 or something reduces it e... read more »

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


Ask Ben: Building A jQuery And ColdFusion Rating System

Posted: July 6, 2009 at 3:10 PM by Ben Nadel

Tags: Ask Ben, ColdFusion, Javascript / DHTML

Check out this page... http://csssnap.com/ Look at the ratings widget under each thumbnail. Is this possible with CF? It seems to update on the fly (is that Ajax + jQuery) to a database that then spits back the average of all the votes. It then blocks you from voting again if you have already voted (perhaps via IP tracking). Since I have no clue (... read more »

Comments (20)  |  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 (6)  |  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 (11)  |  Post Comment  |  Ask Ben  |  Permalink

Showing 1 - 15 of 170   Pages: 1 2 3 4 5 6 7 8 9 10 » < Prev | Next >
Recent Blog Comments
Jill
Nov 7, 2009 at 7:58 AM
How To Unformat Your Code (Like A Pro)
LMAO - this was pretty funny! I have to admit - I also love to reformat code so I can read it. My boss used to tell me to leave my OCD at home. Now I don't feel so bad after reading everyone else' ... read »
Nov 6, 2009 at 10:10 PM
How To Unformat Your Code (Like A Pro)
The timing of this post is just uncanny. I spent the last 15-20 minutes manually un-formatting my "Ben Nadel" style code within a CFC of mine. I was really digging the readability a few weeks ago, bu ... read »
Roe
Nov 6, 2009 at 5:11 PM
Passing Arrays By Reference In ColdFusion - SWEEET!
ArraySort also reorders the results of these java obj's ... read »
Nov 6, 2009 at 4:53 PM
How To Unformat Your Code (Like A Pro)
I tried to go *back* the other way. Adding formatting is actually a much more complicated problem than removing formatting. Anyway, here is what I could put together with a minimal amount of time: ... read »
Asaf
Nov 6, 2009 at 2:35 PM
ColdFusion GetPageContext() Massive Exploration
Hi, I actually found this post useful. I recently acquired a SSL certificate for my website and when I switched over to HTTPS Internet Explorer would throw an error when trying to download a dynamic ... read »
Nov 6, 2009 at 2:19 PM
How To Unformat Your Code (Like A Pro)
@Chuck, @Nathan, Well, now I feel like it's a challenge.... I accept. ... read »
Nathan Stanford
Nov 6, 2009 at 2:06 PM
How To Unformat Your Code (Like A Pro)
@Chuck, I would love it as well. I was not joking I am very serious I love well formatted code. ... read »
Chuck
Nov 6, 2009 at 1:54 PM
How To Unformat Your Code (Like A Pro)
Ben great job, I happen to like your coding style and find it very easy to understand and follow. @Nathan, I totally agree, I (like the rest of you I assume) am pretty meticulous when it comes to c ... read »