A short tale about squashing a bug.
You see, my mistrust for IE made me miss the real problem. What was happening was that in IE 7 on Vista, a site I’m building for a client was not loading any Javascript. It wasn’t even loading the base Javascript "jquery.js" and "drupal.js", so my site theme Javascript wasn’t working at all.
I dug in and began tracing code using my typical technique of embedding "drupal_set_message()" calls in the suspect areas. Sure enough, no Javascript was getting loaded, but only when I used my IE test machine.
The cause
I was not logged-in on the IE machine. So Drupal didn’t think I needed any Javascript. Nowhere in the code was "drupal_add_js(anything.js)" called since I didn’t have any modules that needed any Javascript.
In that case, Drupal doesn’t load any Javascript at all, so none was loaded. It was a feature, not a bug.
The fix
I just enabled one of the modules that I had been planning to use anyway, which uses the "drupal_add_js(anything.js)" call. Suddenly my IE testbox worked fine.
For once, it really wasn’t IE at fault. Amazing.
Technorati Tags: drupal, javascript
















1 response so far ↓
1 tim // Jul 20, 2008 at 1:38 pm
So… how did you fix it?
Leave a Comment