Tuesday, August 25, 2009

FusionCharts, IE6, and "Unknown runtime error"

FusionCharts' JavaScript file makes use of innerHTML to replace a placeholder <div>'s content with the generated SWF. However, on IE6, this causes an "Unknown runtime error".

I am working with version 1.2.4. I have jQuery 1.3 loaded on the site, so I replaced four instances of innerHTML calls with $().html() syntax:

Line 237:
{ n.innerHTML = obj.getSWFHTML(); },false );
became
{ $(n).html(obj.getSWFHTML()); }, false);

Line 242:
{ n.innerHTML = obj.getSWFHTML(); } );
became
{ $(n).html(obj.getSWFHTML()); });

Line 246:
n.innerHTML = this.getSWFHTML();
became
$(n).html(this.getSWFHTML());

Line 251:
n.innerHTML = this.getSWFHTML();
became
$(n).html(this.getSWFHTML());

Saturday, July 25, 2009

jQuery execution after image load

If you need to run JavaScript that's based on some attribute of a loaded image (e.g. height or width), use a callback with $(window).load() instead of $(document).ready().

Friday, June 5, 2009

Pure T-SQL (Geo) Distance Calculations

Awesome post by Joe Finsterwald (http://www.wtfdeveloper.com/Default2.aspx) shows how to implement geographical distance calculation functionality in pure T-SQL.

Monday, April 27, 2009

T-SQL Epoch Date Conversion

I needed a way to convert a BIGINT containing a date in SSE (seconds since epoch - 1/1/1970) format into a DATETIME. The following query does the trick:

SELECT DATEADD(DAY, CAST(sse_value AS BIGINT)/86400000, CAST('19700101' AS DATETIME))

Thanks to some guy named Steve Kass for pointing this out on DevelopmentNow.

Saturday, April 11, 2009

Safari color issues?

If you're experiencing color issues with your images in Safari, make sure that an embedded color profile was not saved with the image. Open the image in Photoshop; File --> Save As; uncheck Embed Color Profile; save image.

Wednesday, January 7, 2009

Another IE z-index bug workaround tip thingy

If you're having trouble getting z-indexes to work right in IE, the order of your style declarations in your css file might matter. Try putting the style code for the element you want to stack on top at the bottom of your css file and see if the problem persists.