Viewing posts in: JavaScript

I wrote this extender to more easily handle outputting observable arrays in row+column layout.  Typically, when running a simple foreach loop to display the content of an observable array you’re forced to include the row+column logic within the view itself or you have to write additional helper functions in the view model.  I ran in […]

I noticed a subtle but nice feature on the Google News main page recently.  The left-hand navigation that has the various section headings remains fixed to the top left area as you scroll down but it does not overlap the top banner area.  Also, if your browser window is too small to fit the entire […]

Recently a client wanted to have a user agreement added to an enrollment form. The catch was that I needed to confirm that the user had at least scrolled through the text before allowing them to continue on with the form submission. Once again, jQuery to the rescue!

Google Static Maps

This is a nice utility for embedding a static version of a Google Maps location. For example, if you didn’t want to actually embed the fully functional Google Map but just an image of that map you can use this to dynamically generate it based on URL parameters. That means if the address changes or you […]

This is a nice little plugin for easily adding auto-complete functionality to form fields. All it looks for is a datasource formatted as JSON. I’ve put an example here using PHP to access a dinosaur name database returning the previously stored values. https://www.hereswhatidid.com/coding/autocomplete/ The project site is here: http://jqueryui.com/demos/autocomplete/ jQuery Code: [sourcecode lang=”javascript”](function($) { $(function() […]

It’s always worth looking up a function that you may be using heavily to see if there’s a faster way to call it. For example, getting and setting variables using the data() function within jQuery can vary greatly depending on how you call it. Here’s a site that compares the speed differences in various browsers: […]