Creative Juices Bo. Co.

Satisfy Your Thirst For Something Refreshing!

Javascript and I Need Some Closure

JSLint Keeps Warning Me About Calling a Function Within A Loop

I use JSlint to check my JavaScript on a regular bases, most of the time it just for light scripts that I just need to check to make sure that I don't have a typo. But occasionally I check more robust scripts and I find myself presented with an error message that says "Problem at line XXX character XX: Be careful when making functions within a loop. Consider putting the function in a closure".

I know I've come across this in the past and I know that I fixed it, but the problem is I can never remember what the heck I did to fix it. Then I remembered that I have a blog! I can just put it there and never have to search far for the answer ever again!

Here's the problem:

function myHappyFunction() {
   var a = document.getElementsByTagName('a');
   for(var i = 0; i <= a.length - 1; i++) {
      a[i].onclick = function(e) {
         alert('Ouch!');
      };
   }
}
read full article...

Shared Hosting Woes

ColdFusion Site Timeouts? Check To See If Your Database Server.

Awhile back I had switched one of my clients websites from CrystalTech to HostMySite. The site on CrystalTech was inaccessible at least 2 times a day, due to either a ColdFusion/JRun restart or some other problem. Talking it over with the client, we decided it would be a good time to update their code and move it on over to HostMySite.

Almost immediately, we noticed some speed gains, but again we started to see that the site would go down once a or twice a day. I was starting to wonder if it was my code, but I had been running it internally on my server with no problems at all. My server is about 7 years old with only 1 gig of ram. Surely, if it could run on this junker, it should run fine on our ISP's shared server.

read full article...

IE6 and IE7 does not like you using setAttribute on style

setAttribute("style","YOUR STYLE INFO")

I'm right in the middle of a couple of large projects right now, hence the lack of posts lately, but I wanted to share a little problem I just ran into with everyone.

I like to keep my JavaScript condensed, so I like to use setAttribute for style information. But one of my clients reported a problem with a simple survey window I created recently. Apparently, Internet Explorer (go figure) wasn't playing nice with the script I created.

read full article...

You've Just Entered the IE6 Dead Link Zone

A Quick Fix for the dreaded Internet Explorer 6.0 (IE6) Unclickable Links

Every once in awhile I create a website and start testing things in IE6 only to find that my navigation or another links is "unclickable". I know I've Googled this about a zillion times, but to be honest I can't remember the exact problem (I think it might be a box-model positioning error or something like that).

Anyway, I was testing a site today and ran into the problem again, so I thought I would share it with you. The fix is fairly simple, all you need to do is set your CSS position rule to relative in your CSS stylesheet for any links having the problem.

Example CSS

#myNav a { position: relative; }

Pretty simple, huh? So happy coding and let me know if you have any insight into this.

read full article...

My Blog Dilemma

Mango vs. BlogCFC

Awhile back I switched my blog from BlogCFC to Mango Blog. The reason I made the switch was simple. I wanted more control over the layout and BlogCFC seemed overly complicated for this task. I have been patiently waiting for version 6, that Raymond Camden has been hinting at for the past 6 months. (Maybe even a year). This version was supposedly more geared towards using templates. As exciting as this news was, it seemed as the progress was moving slowly. And I had to make a decision on my own blog, hence I made a switch.

I really like some aspects of Mango Blog, especially their plug-in architecture and their administration controls. But at the same time, I miss some of the more robust features the BlogCFC had, like subscriptions, stats, etc. And another key point, was that BlogCFC would never pass the W3C's XHTML Validator. It was laced with errors and warning. Mango on the other hand was perfect in that aspect.

read full article...