LearnCF http://learncf.com Learn ColdFusion Tutorials Sat, 13 Mar 2010 12:16:17 GMT jQuery Introduction Part 3 http://tutorial44.learncf.com This is part 3 of a 3 part series: So we’ve now loaded a number of football teams from the server, after the page has loaded... without a page refresh. But wouldn’t be useful if clicking on one of those team names displayed a list of players on that team? Sun, 20 Sep 2009 14:00:00 GMT http://tutorial44.learncf.com jQuery Introduction Part 2 http://tutorial43.learncf.com This is part 2 of a 3 part series. Now that you’ve hopefully got a good handle on getting JSON data via jQuery, let’s look at using ColdFusion to provide that data. Wed, 09 Sep 2009 14:00:00 GMT http://tutorial43.learncf.com jQuery Introduction Part 1 http://tutorial42.learncf.com jQuery is a “fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way you write JavaScript” (source: http://www.jquery.com ). jQuery on the client makes things as simple as ColdFusion on the server. Using the two together, you can create AJAX applications (refreshing content on the client without reloading the page) quickly and easily. jQuery provides a number of ways to bring content from the server to the client. In this tutorial, we’ll look at jQuery’s getJSON() method. getJSON() loads JSON data using an HTTP GET request (source: http://docs.jquery.com/Ajax/jQuery.getJSON Tue, 01 Sep 2009 14:00:00 GMT http://tutorial42.learncf.com Select like with cfqueryparam http://tutorial41.learncf.com cfqueryparam is a fantastic part of ColdFusion it helps protect from SQL injection and improves performance. It is a little differnt to use then normal querys and one question that often gets asked is "How do I do a like clause with cfqueryparam?". Well here is the answer. line 4 of search_result.cfm <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="%#FORM.keyword#%"> Remember the % % goes around the varibale ( or plain text string ) Sun, 30 Aug 2009 14:00:00 GMT http://tutorial41.learncf.com Create Update Delete example http://tutorial40.learncf.com This is a tutorial for creating a simple content management system in ColdFusion. This is not a full-blown content management system, but a way to add, delete, and modify database records, which is a very common task when using ColdFusion. Sun, 09 Aug 2009 14:00:00 GMT http://tutorial40.learncf.com Deserializejson - Twitter example http://tutorial39.learncf.com Workign with JSON in ColdFusion is easy. The two functions deserializeJson and serializeJson are easy to use and work the same way on the three main CFML engines. Mon, 22 Jun 2009 14:00:00 GMT http://tutorial39.learncf.com CFFEED - Twitter example http://tutorial38.learncf.com As Twitter's popularity continues to increase, users and consumers of the information being broadcast are looking for quick and easy ways to integrate some of the information into their own content. So I whipped up this short, but sweet, example of how easy it is to repurpose content from Twitter using just a dash of ColdFusion. Wed, 17 Jun 2009 14:00:00 GMT http://tutorial38.learncf.com CFCOOKIE example http://tutorial37.learncf.com Cookies are an essential part of modern web applications, often being used as a key element of user authentication. In a nutshell, cookies are values sent between a browser and a webserver and stored on the client's PC on a per domain basis. For example: username=fakeuser;password=5f4dcc3b5aa765d61d8327deb882cf99 In ColdFusion, these cookies can be accessed through the 'cookie' scope, with cookie.username and cookie.password . Setting cookies is just as easy with the CFCOOKIE tag. All it needs is the name, and the value (The expiration time is optional). To clear a cookie, all you need to do is set the cookie with an expiration of "NOW". Mon, 08 Jun 2009 14:00:00 GMT http://tutorial37.learncf.com Resizing images on the fly. http://tutorial36.learncf.com Resizing images on the fly with Coldfusion is easy. While it does put a strain on your server you may have a valid reason for wanting to do this. Mon, 25 May 2009 14:00:00 GMT http://tutorial36.learncf.com Adding an alternating Image to CFGRID http://tutorial35.learncf.com This tutorial is the extension to my previous tutorial. This tutorial is using the "cfdocexamples" datasource. In this tutorial "Contract" column has the boolean data in the format of "Y/N". In grid the "Tick" images shown if the value of contract column is "Y" otherwise it display the "Cross" image. Thu, 14 May 2009 14:00:00 GMT http://tutorial35.learncf.com Adding an image into CFGrid http://tutorial34.learncf.com This demo demonstrates how to add an image to a cell in CFGrid Fri, 24 Apr 2009 14:00:00 GMT http://tutorial34.learncf.com Recursion Fun http://tutorial33.learncf.com A while back I did a recursion experiment in ColdFusion by doing a Factorial function which in college is one of the classic programming examples used to teach recursion. I'm not even sure where you would use recursion these days, except in programming classes. I have not run across the need for it in ages, but for some reason I was compelled to try this little experiment. Is there really a need for recursion these days, or are we overlooking a power tool? Either way Coldfusion does support recursion and it does have its uses although possibly much less common these days. Sat, 28 Mar 2009 13:00:00 GMT http://tutorial33.learncf.com Query of Query example. http://tutorial32.learncf.com Here's the problem. The table in our database looks like: Example A - Type 1 Example B - Type 1 Example C - Type 1 Example D - Type 2 Example E - Type 2 Example F - Type 2 Example G - Type 3 Example H - Type 3 Example I - Type 3 But our client/boss/customer wants to display the data on the web page like this: Type 1: Example A, Example B, Example C Type 2: Example D, Example E, Example F Type 3: Example G, Example H, Example I So how do we get from table to page? It's honestly not difficult in hindsight, but I had to combine a few items I don't often use in my daily routine to accomplish it Sun, 22 Mar 2009 13:00:00 GMT http://tutorial32.learncf.com Using the isLeapYear function http://tutorial31.learncf.com This tutorial will show you how to use the 'isLeapYear' function in ColdFusion. Fri, 20 Mar 2009 13:00:00 GMT http://tutorial31.learncf.com Cfhttp simple example http://tutorial30.learncf.com This is a simple example of cfhttp in action. Fri, 13 Mar 2009 13:00:00 GMT http://tutorial30.learncf.com Cfdirectory example. http://tutorial29.learncf.com This tutorial will show you how to use the different functions of the CFDIRECTORY tag in ColdFusion 8 Wed, 11 Mar 2009 13:00:00 GMT http://tutorial29.learncf.com Crop and re-stitch with cfimage demo http://tutorial28.learncf.com With CFIMAGE you can crop images really easily and draw new images. This gives you the option of stitching together multiple images. In this example I tear apart a simple image then stitch it back together in a new image and write it to the browser. Tue, 10 Mar 2009 13:00:00 GMT http://tutorial28.learncf.com Using CFFEED to create a RSS Feed Tutorial http://tutorial27.learncf.com In this tutorial, I show how to retrieve information from a database and create a valid RSS 2.0 feed from this data. This tutorial should be easily adaptable for your own needs. Wed, 23 Jan 2008 13:00:00 GMT http://tutorial27.learncf.com Creating Square Thumbnails Tutorial http://tutorial26.learncf.com I recently worked on a project that allowed users to upload images and I then needed to create different versions of the image... a 1200 x N, 430 x N, and 75x75... wait it has to be square!? Yeah that was my first thought, nah that won't work What about stretching it? Nope that looks like junk What about white bars ALA Your DVD player? Image is too small and they want the image to fill up the whole square. Hmm how about a nice sized-down-then-chopped image? yeah that would look cool. So how do we do it? Tue, 22 Jan 2008 13:00:00 GMT http://tutorial26.learncf.com Random Images Tutorial http://tutorial25.learncf.com Have you ever wanted to simply pull a single random image from a specified folder on your site? This useful bit of code is just the thing. Mon, 21 Jan 2008 13:00:00 GMT http://tutorial25.learncf.com Get href labels using RegEx Tutorial http://tutorial24.learncf.com Ever wondered how you could use regex to find all the link labels in a string. Not the links - but the label for the link. It is relatively easy to grab all the matches for a regex in ColdFusion 8, consider the following code block: Thu, 29 Nov 2007 13:00:00 GMT http://tutorial24.learncf.com A Basic sleep() Tutorial http://tutorial23.learncf.com Ever wanted to pause a currently running request? You can now, in CF8, using the new sleep() function. Some will recognize it as an easier way to call the java thread.sleep method. It's been added primarily as part of the multi-threaded processing (CFTHREAD) feature, such as when one thread needs to wait upon another. But it can be useful sometimes on its own, such as when you want to simulate a long-running request for any reason. (And it's a whole lot more server-friendly than doing a huge cfloop, since a sleep call doesn't really spin the CPU. It literally halts the current request, putting it to "sleep".) Sat, 01 Dec 2007 13:00:00 GMT http://tutorial23.learncf.com Create a Watermark using CFIMAGE Tutorial http://tutorial22.learncf.com I was thinking it would be cool if ColdFusion could watermark images for me. After about 30mins playing around I came up with this. Sun, 25 Nov 2007 13:00:00 GMT http://tutorial22.learncf.com Transparent Images with ColdFusion 8 Tutorial http://tutorial21.learncf.com ColdFusion 8's new Image manipulation functionality is pretty awesome, I think we can all agree on that. The documentation on how to use it is also very clear on all aspects except on the topic of creating transparent images. The live docs are not only unclear as to how one can do this but also whether or not this is even be done with CF8. Mon, 26 Nov 2007 13:00:00 GMT http://tutorial21.learncf.com Generate XML Tutorial http://tutorial20.learncf.com As of ColdFusion MX, there are several tags and functions that make working with XML a snap. In this tutorial I am going to demonstrate how to use these tools to generate an XML document. Thu, 22 Nov 2007 13:00:00 GMT http://tutorial20.learncf.com Using CFIMAGE to Generate Thumbnails Tutorial http://tutorial19.learncf.com Here is a tutorial I created using the new CFIMAGE tag in Coldfusion 8 to create thumbnails. Sun, 18 Nov 2007 13:00:00 GMT http://tutorial19.learncf.com Parsing XML Tutorial http://tutorial18.learncf.com There are many, many uses for XML, and if you use ColdFusion to consume web services, or create data integration processes, then chances are, you will need to work with XML. As of ColdFusion MX there are several tags and functions that make working with XML a snap. In this tutorial I am going to focus on teaching you how to pull the information you need out of XML documents. Thu, 15 Nov 2007 13:00:00 GMT http://tutorial18.learncf.com Using CF8 and .NET to get OS Information http://tutorial17.learncf.com This Tutorial describes how to get the following Operating System Information from ColdFusion using .Net functions. Hard Disk Information IP and Computer Name Mac Address Computer Information Tue, 23 Oct 2007 14:00:00 GMT http://tutorial17.learncf.com ColdFusion 8 Dynamic Menu Tutorial http://tutorial16.learncf.com One of my pet peeves is that I can never find realistic working examples of CF code in the documentation. Yes there are many examples on CFMenu static code that demo the features, but my code shows how to build a dynamic menu from a database query using the cfdocexamples database installed with CF8. Tue, 23 Oct 2007 14:00:00 GMT http://tutorial16.learncf.com Accessing .NET Hashtable in ColdFusion Tutorial http://tutorial15.learncf.com A .NET hashtable can be used as a Structure in coldfusion, the example below explains the necessary steps. Create a Class Library which generate Hashtable (collection or structure) Call the .Net method from Coldfusion Thu, 18 Oct 2007 14:00:00 GMT http://tutorial15.learncf.com New CF8 File Functions Tutorial http://tutorial14.learncf.com This tutorial shows you some of the new ColdFusion 8 file based functions. It takes a file and appends lines to it until it reaches a size then starts again. Wed, 17 Oct 2007 14:00:00 GMT http://tutorial14.learncf.com Ajax is Easy with CFAJAXPROXY Tutorial http://tutorial13.learncf.com How hard is doing Ajax? Well with ColdFusion 8 it's easy, very easy. This tutorial, shows just how easy it is to call CFC methods both without and with paramaters. Not only is it easy, the calls are quick, if you haven't tried Ajax, this is a must read. In case you are not sure what Ajax is, it's the ability to communicate from the browser back to a server, without the need for page refreshes. The Ajax calls can also return values, so you have two way communication. You will notice that the results of the buttons in the demos are very quick and the browser does not refresh. Tue, 16 Oct 2007 14:00:00 GMT http://tutorial13.learncf.com Using CFPRESENTATION Tutorial http://tutorial12.learncf.com This tutorial provides an introduction to using the CFPRESENTATION and associated tags. Sat, 13 Oct 2007 14:00:00 GMT http://tutorial12.learncf.com CF8 Accessing .NET DLLs Tutorial http://tutorial11.learncf.com This tutorial provides an example of Coldfusion 8 and .net integration. Wed, 26 Sep 2007 14:00:00 GMT http://tutorial11.learncf.com Auto Save Form Tutorial http://tutorial10.learncf.com ColdFusion 8 cfform tag comes with javascript libraries that enable AJAX form submission. This example ties this in with some Javascript to autosave the form at a specified number ofmilliseconds. Wed, 26 Sep 2007 14:00:00 GMT http://tutorial10.learncf.com Return Identity Values Tutorial http://tutorial9.learncf.com If you are using a database table with an identity (auto-increment) field, ColdFusion 8 can automatically return the newly created field value for you, without needing a trigger or a subsequent <CFQUERY>. All you need to do is look in the <CFQUERY> optional RESULT structure, and if available the value will just be there. This feature is very DBMS and driver specific (and may not work with all databases), and the name of the structure member containing the generated value is different based on the DBMS being used. Here are the ones you should be aware of: SQL Server: result.IDENTITYCOL Oracle: result.ROWID Sybase: result.SYB_IDENTITY Informix: result.SERIAL_COL DB2: result.KEY_VALUE MySQL: result.GENERATED_KEY (MySQL 4+) Apache Derby: result.IDENTITYCOL Thu, 13 Sep 2007 14:00:00 GMT http://tutorial9.learncf.com CFFORM with Custom onSubmit Tutorial http://tutorial8.learncf.com I've seen a couple of people trip over this so I thought I'd write something about the issue. Mon, 10 Sep 2007 14:00:00 GMT http://tutorial8.learncf.com Simple Auto Suggest Tutorial http://tutorial7.learncf.com This tutorial shows just how simple an Auto Suggest field is with ColdFusion 8 Sun, 09 Sep 2007 14:00:00 GMT http://tutorial7.learncf.com Basic CFWINDOW Tutorial http://tutorial6.learncf.com Gone are the days of cumbersome javascript popup windows. Enter CF8's CFWINDOW! We all use, at some time or another, popup windows; CFWINDOW is a very simple yet affective way of achieving these. Let’s break down the CFWINDOW tag and see how simple this tag really is. Sun, 02 Sep 2007 14:00:00 GMT http://tutorial6.learncf.com CF can do OO Tutorial http://tutorial5.learncf.com This is a basic example of OO in CF Thu, 30 Aug 2007 14:00:00 GMT http://tutorial5.learncf.com Simple introduction to CFIMAGE Tutorial http://tutorial4.learncf.com This is a simple introduction to the new CF image tags and some of the neat and easy features. Thu, 30 Aug 2007 14:00:00 GMT http://tutorial4.learncf.com Simple Charting with CFCHART Tutorial http://tutorial3.learncf.com This tutorial shows you how simple it is to chart data using CFCHART. Wed, 29 Aug 2007 14:00:00 GMT http://tutorial3.learncf.com Tabs With CFLAYOUT Tutorial http://tutorial2.learncf.com This tutorial shows some of the features that you can easily achieve using the <cflayout and <cflayoutarea tags. Tue, 28 Aug 2007 14:00:00 GMT http://tutorial2.learncf.com Paging With CFGRID Tutorial http://tutorial1.learncf.com This tutorial shows how simple it is to do paging of a recordset using CFGRID. Mon, 27 Aug 2007 14:00:00 GMT http://tutorial1.learncf.com