jQuery & IE – Naming functions and elements

24 May

After so many lines of code in the past decade, we ran onto an issue which should never happen if you follow naming standards… still, a moment of tardiness at 3am after 18 hours long work day you ran onto these as well, and I wanted to share.

Simple, ridiculous, but possible, and guess what – IE doesn’t like it:

– here’s my element:
<div id="DoSomething"></div>

– here’s my action link:
<a href="#">Click here</a>

– here’s my function:
function DoSomething() {//whatever}

Clicking the link won’t work in IE and Safari. Firefox and Chrome are just fine with it.

Note to myself: Follow naming conventions at all times, functions and elements should never have the same name!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: