Recent blog posts covering ColdFusion, jQuery, Web Development, and other topics
Updated: 9 weeks 3 days ago
Javascript Multiline Regular Expressions Don't Include Carriage Returns In IE
In a Regular Expression (RegEx) pattern, the ^ and $ characters typically match the start and end of an entire string. However, if you run a regular expression pattern in "Multiline" mode, the ^ and $ characters should match the start and end of each individual line, respectively. This is a pattern construct that I typically use on the server-side for data file parsing. On the client side, however, I very rarely use it. And, because of this seldom usage, I tend to forget that ... Read More »
Categories: Blogs
Different Browsers Use Different Non-Matching Captured RegEx Pattern Values
Yesterday, Alec Perkins brought it to my attention that Chrome was passing in an undefined value for a non-matching, captured group in a regular expression (RegEx) replace function. This is a different behavior than Firefox, which passes in an empty string for non-matching, captured groups. I typically only test my Javascript in Firefox (yes, it's a bad habit); so, after hearing this, I wanted to test this feature in a few different br ... Read More »
Categories: Blogs
How Javascript Loading And Blocking Works By Default
This morning, I was going to look into LABjs which Kyle Simpson recommended to me as a way to easily load Javascript files in parallel without blocking the rest of the page content. Before I did that, however, I wanted to take a look at how browsers handle Javascript loading by default. This way, I could get a good baseline to which the non-blocking approach could be compared. When I did this ... Read More »
Categories: Blogs
Loading Remote jQuery Template Markup Language (JTML) Templates
All of my previous jQuery Template Markup Language (JTML) demos have involved using templates that were immediately available in the current page. As such, I thought I would try writing some code that loaded a JTML template asynchronously from the server before it could be rendered. I have never personally loaded remote templates before - using JTML or any other templating method ... Read More »
Categories: Blogs
jQuery Template Markup Language (JTML) AJAX Demo
After publishing the jQuery Template Markup Language (JTML) project with a basic, single-page demo, I thought I'd put together a simple AJAX demo. In this example, the JTML template is still defined on the main page; but, the JSON data used to populate the template is being pulled down from the server using jQuery AJAX. Once the data is pulled down, it is merged with the template and append ... Read More »
Categories: Blogs
Javascript Function() Constructor Does Not Create A Closure
Yesterday, when I was building the basis of the jQuery Template Markup Language (JTML) , I made use of Javascript's Function() constructor to dynamically generate HTML template rendering engines. I've only use the Function() constructor once or twice before so I'm not too familiar with it. I know that ordinarily, ... Read More »
Categories: Blogs
The jQuery Template Markup Language (JTML) Project
After this morning's post about my jQuery Template Markup Language (JTML) concept , I added a bit more functionality and gave JTML its own project page . Now, I can start adding and refining functionality as I think of it. If you missed the earlier post, JTML provid ... Read More »
Categories: Blogs
Experimenting With The jQuery Template Markup Language (JTML)
Yesterday, on the YayQuery podcast , the group talked briefly about the jQuery Template proposal . This is the proposal outlining how jQuery might eventually handle templating - the act of rendering output based on a given template and a set of data. I took a brief look at the current proposal and a bunch of the ideas just didn't look right to me (grant ... Read More »
Categories: Blogs
jQuery Event Bindings On Javascript Objects With A Length Property
The other day, I ran into a very interesting behavior involving jQuery event binding and Javascript objects . While it is still an open question as to whether or not jQuery truly supports non-DOM-object event binding , it is a feature that appears to be active ... Read More »
Categories: Blogs
FLEX On jQuery: Array Collections For jQuery Data Binding
The other day, on my FLEX On jQuery blog entry , Johan brought up data binding in the comments. Several other people have also mentioned data binding in the context of jQuery. Data binding, as a concept, is something that I am only vaguely familiar with; as such, I wanted to start playing around with some data binding ideas. The first thing I did was look at the FLEX ... Read More »
Categories: Blogs
You Cannot Bind The Submit Event To Objects Using jQuery
One of the coolest things about jQuery is that you can both bind and trigger events on non-DOM-node objects . However, over the weekend, while I was working on my SRCHR submission - a client-only, YQL-powered search engine - I found out that this technique d ... Read More »
Categories: Blogs
SRCHR - A Client-Only YQL-Powered Search Engine With jQuery
A couple of weeks ago, YayQuery podcaster, Rebecca Murphey posted a blog entry about a project called SRCHR . This was supposed to be a 100% client-side search engine powered by YQL (Yahoo Query Language) and jQuery. The idea behind this post was to crowd-source the development of such an application such that we could see the various ways in which different people might approach the ... Read More »
Categories: Blogs
Using jQuery To Pass Arrays To Remote ColdFusion Components
Yesterday, I was reading an interesting post over on Ray Camden's blog about passing arrays in a jQuery AJAX request to a remote method on a ColdFusion component. Passing complex objects like structs and arrays to a ColdFusion method is trivial when done on the ColdFusion server; but, when this type of method invocation is performed over HTTP, complex objects ... Read More »
Categories: Blogs
How Much Should jQuery Event Bindings Handle?
Last week at the jQuery NYC meetup, I posed the following question: How much should jQuery event bindings actually handle? When I write spaghetti code, the answer to this is fairly straightforward - whatever gets the job done, refactor as necessary. But, as I move into a more object-oriented, Component-based approach, the answer to this question becomes somewhat less clear in my mind. Unfortunately, no one at the jQuery meetup seemed interested in having a philosophical debate as to where cod ... Read More »
Categories: Blogs
FLEX On jQuery: Handling Mouse-Down-Outside Events
A little while ago, Ben Alman released a jQuery plugin that created special jQuery event types for "outside" user events . This plugin allows you to listen for events, such as clicks, that happen outside of a given element. Ben's plugin is rather awesome and it seemed like a piece of functionality that would be great to explore from a FLEX point of view. Ov ... Read More »
Categories: Blogs
Your jQuery Selector Context Can Be A jQuery Object
This is just a quick post to clear up any confusion over what kind of objects can be used as a context when performing a jQuery selector execution. Sometimes, when reviewing jQuery code, I see people make data type conversions in their context usage: $( "div", myStuff[ 0 ] ) Here, you can see that the programmer is converting their "myStuff" jQuery collection into a single DOM node to be used as a selection context. This might make sense if the m ... Read More »
Categories: Blogs
FLEX On jQuery: Extending The jQuery Event Object
Last week in my FLEX On jQuery series with Joe Rinehart , I explored the idea of creating non-coupled UI elements that communicate indirectly through the use of event listeners and modifiable event behaviors . In that experiment, I used the core jQuery Event object with custom event types to model custom events; but, I ... Read More »
Categories: Blogs