Overriding setInterval with a better implementation

JavaScript includes two built-in options for timing and delaying actions, setInterval() and setTimeout(). These functions have been around since before the first ECMA specifications, so their implementations across browsers are largely non-standardized and inconsistent. I’ve noticed some problems with setInterval(), particularly when it’s left in a background tab. See the issues and how to solve them

Tagged with: ,
Posted in Custom Library Functions, GitHub, JavaScript

Self-hosted moderated chat room and liveblog project

A few months ago I contacted Brian Cook, proprietor of one of the best sports blogs on the Internet, MGoBlog. A year or so earlier I had created a userscript that improved some functionality for his site, and I thought he might be interested in building some of that JS directly into the site so it would benefit every user. Instead we ended up discussing a few other projects, including an open-source alternative for the relatively expensive moderated liveblog systems the site uses for Michigan football gamedays. These are the results of that project so far. See the project

Tagged with: , , , , ,
Posted in GitHub, HTML & CSS, JavaScript, jQuery, MySQL, PHP, Server Side Code

Google Chrome for Windows is terrible at web fonts

Dear Google Chrome: get better at web fonts. Seriously, this is bordering on unacceptable. This is a company that provides the fantastic Google Web Fonts service, and their own browser manages to render fonts worse than any browser I’ve ever used, including ancient IE. That’s right, I said it, on at least this one issue, Chrome is significantly worse than even Internet Explorer. Harsh but true. Some Workarounds

Tagged with: , ,
Posted in HTML & CSS, JavaScript

Graceful degradation of jQuery event handlers

If you saw my post on SharePoint custom ribbon actions, you may have noticed the section where I had to lay out several options for jQuery’s persistent event handlers because I couldn’t know which version of jQuery the solution would be used with. Since I’ve written a few projects that are designed to be inserted into existing sites, I thought it would be a good idea to build a system to easily manage the graceful degradation of these handlers. How I did it

Tagged with:
Posted in Custom Library Functions, GitHub, JavaScript, jQuery

Using an Ajax powered web form to update a database

As part of the preparation for my upcoming wedding to a wonderful lady, I’m in charge of building our wedding website, which we’ve decided will handle all of our RSVPs. I’m still in the process of building the RSVP form for that site, maybe I’ll do a full post about it and all its features once it’s done. But this process did give me an idea to build a more universal and flexible web form, which could easily be plugged into any LAMP environment and used to push form responses to a database using Ajax. How I did it

Tagged with: , , ,
Posted in GitHub, HTML & CSS, JavaScript, MySQL, PHP, Server Side Code

SharePoint 2010 custom ribbon actions project

One of the things I’ve found myself building in several different SharePoint projects are customized ribbon actions. The ribbon in SharePoint is a really useful tool, and the fact that it’s completely customizable makes it exceptionally powerful. I’ve put together some of the more universally useful ribbon actions that I’ve worked on into one generic solution which could be a great benefit to anyone looking to provide their SharePoint authors with more functionality. Read more ›

Tagged with: , , ,
Posted in CodePlex, HTML & CSS, JavaScript, jQuery, SharePoint, SharePoint Frontend

Creating custom SharePoint 2010 ribbon actions

If you saw my post on a set of custom ribbon items I created, you’ll know that custom ribbon actions in SharePoint 2010 can be a very powerful tool. In this post I’ll go through the basics of what it takes to connect a custom action to a ribbon button using some handy SharePoint custom JavaScript. Read more ›

Tagged with: ,
Posted in HTML & CSS, JavaScript, SharePoint, SharePoint Frontend

Get query string values from JavaScript

I found this code a while ago, probably somewhere on Stack Overflow, and it’s served me well ever since. It returns a data object filled with the key-value pairs of the query string. Try it!

Tagged with:
Posted in Custom Library Functions, JavaScript, Try It

Rounding prototypes for JavaScript

JavaScript does include some standard methods for rounding numbers, but if you’re working on a project that involves calling them frequently, it can get a little tiring. Especially if you need to round to a certain number of decimal places as opposed to an integer. I haven’t encountered this situation much, but I though it would be a neat exercise for some new Number.prototype methods. Try it!

Tagged with:
Posted in Custom Library Functions, JavaScript, Try It

A better JavaScript random number generator

Every time I needed a random number in JavaScript, I always ended up building some weird, difficult to read manipulation of the Math.random() method to get a value in the range I needed. After doing this a few times on a few different projects, I decided it would be a worthwhile effort to concoct an all-in-one JavaScript random number generator. Try it!

Tagged with:
Posted in Custom Library Functions, JavaScript, Try It