Ask Ben Web Log Entries
Ask Ben: Detecting When DOM Elements Have Been Removed With jQuery
Posted: June 30, 2009 at 10:11 AM by Ben Nadel
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
Ask Ben: Formatting A Date Span In ColdFusion
Posted: June 25, 2009 at 9:28 AM by Ben Nadel
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 (15) | Post Comment | Ask Ben | Permalink
Ask Ben: Converting Javascript Variables Into ColdFusion Variables
Posted: June 22, 2009 at 9:51 AM by Ben Nadel
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
Ask Ben: Dynamic Form Field Population With jQuery
Posted: June 10, 2009 at 2:49 PM by Ben Nadel
Hi Ben, Sorry for not clear enough with my question. Here is my scenerio. I have three input fields: 1) Empno as a combo box; 2) Ename as a text box, and 3) sal as text box.. Now i have all the empno's from the table in the combo box. AS the user selects one of employee number.. related data (ename and sal) should appear in the text boxes.. Can yo... read more »
Comments (10) | Post Comment | Ask Ben | Permalink
Ask Ben: Collecting And Relating Sibling XML Nodes In A ColdFusion XML Document
Posted: May 22, 2009 at 10:19 AM by Ben Nadel
I am just starting out with xml and CF. I don't get alot of opportunity to go much beyond cfquery and cfoutput so I have welcomed the chance to get into an xml project. This post has helped me a great deal but I am still having trouble. The xml that I am being supplied has the <id> at the same level of the data I need to relate to it. I know... read more »
Comments (8) | Post Comment | Ask Ben | Permalink
Ask Ben: Print Part Of A Web Page With jQuery
Posted: May 21, 2009 at 9:10 PM by Ben Nadel
Ben, great new look!! Quick question, I am implementing a jQuery modal pop-up in my app and I want the users to be able to print only the content of that modal window. Any idea? Thanks! To be honest, I've never done this before, so I am not sure if the following solution is truly cross browser compliant. The jQuery plugin that I authored below wa... read more »
Comments (44) | Post Comment | Ask Ben | Permalink
Ask Ben: Selecting XML Nodes That Have A Given Parent Node Using XPath
Posted: May 5, 2009 at 10:44 AM by Ben Nadel
Let's say I have an XML file with the following data in it: [private information]. Right now, the way the component parses the XML file, it returns all instances of DUNS it finds. Is there any way to limit the tag that is searches through and only return say the DUNS from the BasicInfo parent tag? If so, can you provide an example on how that migh... read more »
Comments (0) | Post Comment | Ask Ben | Permalink
Ask Ben: Executing ColdFusion Custom Tag Code If First Run Only
Posted: May 4, 2009 at 3:42 PM by Ben Nadel
Someone asked me earlier about executing part of a ColdFusion custom tag only if it was the first instance of the tag run of the given page. Basically, what they were trying to do was create reusable UI widgets that had associated Javascript. The given UI widget tags could be used any number of times on the page, but they only wanted the Javascrip... read more »
Comments (14) | Post Comment | Ask Ben | Permalink
Ask Ben: Manually Enforcing Basic HTTP Authorization In ColdFusion
Posted: April 28, 2009 at 9:53 AM by Ben Nadel
I'm working with a remote sms interface through a web service, and our endpoint is a cfc file that they hit. Our cfc returns wddx and is a remote cfc extended through ColdSpring. My question is: if we wanted to return an http statuscode of 401 Bad Credentials in the event Basic http authentication fails, will ColdFusion allow us to simply specify ... read more »
Comments (7) | Post Comment | Ask Ben | Permalink
Ask Ben: Pulling Unique SQL Records That Match ALL Join Conditions
Posted: April 23, 2009 at 10:00 AM by Ben Nadel
The reader question is far too long to put here, but the jist of it was that the reader had a primary table that joined to several "property" tables in a One-to-Many kind of relationship. These properties could be selected in a search form and the reader wanted to be able to return all primary table records that matched at least every selected pro... read more »
Comments (12) | Post Comment | Ask Ben | Permalink
Ask Ben: Changing The Root Node In A ColdFusion XML Document
Posted: April 21, 2009 at 9:20 AM by Ben Nadel
I just had a quick regex. I need to replace the first and last xml nodes in an xml string. Basically was doing a quick and dirty way to change the root node of an xml document instead of creating a new root node and copying recursively all the data from one xml object to the new xml object. I can do a simple find "xxx" and replace it with "yyy" bu... read more »
Comments (6) | Post Comment | Ask Ben | Permalink
Ask Ben: Accessing Cached CFCs With AJAX via Remote Proxies
Posted: April 15, 2009 at 10:12 AM by Ben Nadel
Hi Ben, not sure if you already have a post on this, as I'm kind of at a loss with what to search for. I'm building a small application that makes use of AJAX calls (using jQuery) to a CFC instance, saved in my application scope. Making normal calls to this will persist alreay-added data, like you would expect. However, when I make my AJAX call, i... read more »
Comments (18) | Post Comment | Ask Ben | Permalink
Ask Ben: Using jQuery's triggerHandler() To Skip Default Behaviors
Posted: March 12, 2009 at 9:45 AM by Ben Nadel
Ben, I have a somewhat simple jquery q for you. I have x number of divs... inside each div i have a checkbox next to each checkbox i have a span tag with some text. i want to make it where if they click on the text OR the checkbox, it will highlight that div (addClass('red')). i was looking at using the trigger and when you click on the text porti... read more »
Comments (4) | Post Comment | Ask Ben | Permalink
Ask Ben: Building An AJAX, jQuery, And ColdFusion Powered Application
Posted: March 3, 2009 at 10:37 AM by Ben Nadel
Mr. Nadel, I'm very eager to learn how to create apps like you've created. I'm just getting into AJAX and I'm more of a junior in Javascript. I've been working with Coldfusion for the past 8 years...But I really want to learn how to build my own apps using AJAX...to get a better understanding of how AJAX works, where do I start, and I want to cont... read more »
Comments (22) | Post Comment | Ask Ben | Permalink
Ask Ben: Parsing CSV Strings With Javascript Exec() Regular Expression Command
Posted: February 19, 2009 at 10:03 AM by Ben Nadel
Just curious if you can help me with this.... I have a user enter the following string: website "content approval" new - into a text box and need to break it up so that it is 3 separate words eg: 1) website 2) content approval 3) new I have tried using the following RegEx - "([^\\"]|\\.)*" but this only gets whats enclosed in the double quotes, ... read more »



