Apr
20
I generally save this blog for web development issues,
but have been in a slump lately. So I decided to finally
voice my opinion on a burning issue. The great thing about
it, this can be said with little words.
Q: Is Bonds on steriods?
A: 
Is there really any
doubt?
Apr
09
It's been quite a long while since I
submitted a request to activate Google Analytics on my
website. So long, in fact, that I forgot I even put in a
request in the first place. Then the other day, I checked
my e-mail, and there it was, my invite to Google Analytics.
Needless to say, I immediately went to the site, created an
account, grabbed the necessary tracking code, and
implemented it on my website. I must say, it's great! The
amount of information at your fingertips is fantastic. The
best part: It's FREE!!!
Some of the nice features include:
- Ability to add multiple websites (5 total)
- Ability to Add Multiple Users to View Reports (per
website)
- Geo Map Overly report (I've had visitors from Australia,
Paris, & Athens)
- Overall Keyword Conversion report
- Web Design Parameter reports
- What are the common browsers used to view your site
- What are the common screen resolutions used
- What OSs are being used
Overall, I'd say it was worth the wait (considering it's
free). It's just great to see if people visit your site,
and if so, where do they go. Thanks Google, yet another
amazing product you've created.
Apr
06
I was recently working on an idea I had to be able to
increase and decrease the size of a div using a
little JavaScript. I figured the best way to do this was by
using DOM objects and methods. The specific
nodes I was going to use were getAttribute (to
grab the height of the div) and
setAttribute (to set the new height of the
div). Guess what? It worked great in Firefox,
while returning an error in IE. Surprise, surprise!
getAttribute('style') - The Problem
Using
document.getElementById('[id_of_element]').ge
tAttribute('style') returns a string in Firefox (ex.
"height: 200px"), yet in IE it merely returns
an object. Which means additional code to get this into a
string.
getAttribute('style') - The Solution
var el =
document.getElementById('[id_of_element]');
var styleattribute = el.getAttribute('style');
if (typeof styleattribute == 'string') { // what Firefox
returns
...
} else if (typeof styleattribute == 'object') { // what IE
returns
styleattribute = styleattribute
.cssText;
}
One thing to note here, is that
styleattribute.cssText returns ALL CAPS.
Meaning: if the element contains
style="height:200px;",
styleattribute.cssText will return
HEIGHT: 200px.
setAttribute('style') - The Problem
This just flat out doesn't work in IE. See
entry at quirksmode.org.
setAttribute('style') - The Solution
document.getElementById('[id_of_element]').style.he
ight = 250;
So, there you have it. Yet another reason to hate IE.
At least there's a solution to the problem, albeit a rather
annoying one.