Posts Tagged ‘javascript’

Bug or Stupidity?: jQuery, Imagemaps, and Dynamically Inserting Area Tags

Wednesday, November 12th, 2008

I’ve run across something that is not making any sense to me.

The situation: I’ve got an empty imagemap that I want to dynamically enter area tags into with jQuery. I’ve been trying to insert them using .append() or even .html() and every time I attempt to do so nothing occurs. I can insert text or other tags, but no actual area tags.

Now, if I go oldschool and use document.getElementById(insertnamehere).innerHTML = “inserttagshere” that works. But every variation I can think of to use jQuery methods to add an area tag fails.

Can anyone think of anything obvious that I’m missing here?

JS Has Always Been Hot, But Now It’s Sizzling

Wednesday, October 22nd, 2008

Eric Meyer wrote a little post about new project in development by John Resig called Sizzle that should be making every web designer wet themselves. He’s really excited about this. Almost to the point where in my mind’s eye I can see him skipping down hallways. How excited?

“I’m absolutely going to use it and recommend its use far and wide.”

Sounds pretty excited to me. What is all this enthusiasm being caused by? What is Sizzle?

(more…)

jQuery, JSON and IE – Getting Incorrect Array Length

Tuesday, October 14th, 2008

Has anyone had the following problem? When loading a JSON array (through something like $.getJSON), Internet Explorer will sometimes report the length of the array being one higher than other browsers, with the extra element in the array being blank.

I don’t know if this is a problem in other libraries, but I suspect it is. But I do know that it’s happened to me when using jQuery’s Ajax functions.

Why is this occurring?

I was tormenting myself with this same question on a client project, and discovered that although a bit of browser quirkiness was involved, it was actually an error on my part.

I hate it when it’s me. ;)

(more…)

Yo-Yo

Thursday, April 24th, 2008

I’ve been getting more obsessed with attribute selectors these days. They do such delightful things, and really help me cut down on the markup I need for a site. The problem, of course, is browser compatibility. So I started working on some javascript to give IE7 the functionality for CSS3 attribute selectors.

Then I discovered to my total shock that IE7 actually does support CSS3 attribute selectors.

Someone should tell Sitepoint this, as their reference incorrectly states that it does not.

However, IE6 doesn’t support ANY attribute selectors, so I went to the blackboard again to write a script for that.

Then I discovered that Dean Edwards’ IE7 script does give IE6 attribute support. So I stopped writing my own script and went to check that out.

A while later, I discovered that the Dean Edwards script, however, does not give full support to IE6 for css3 attribute selectors. (Most notably, *= doesn’t seem to work).

So now I’m working on that script again.

I think I’m beginning to understand what a yo-yo feels like.

Solving Impatience with Pseudonut

Sunday, March 2nd, 2008

I tried really hard to start this post with a pop culture reference that somehow allegorically tied Alan Ruck‘s relative anonymity despite his years of acting (including a major role in the pinnacle of 80′s teen films: Ferris Bueller’s Day Off) to the subject of toiling away at web design solutions on a daily basis. After reading what I just wrote, I realize that I may have too much spare time on my hands.

Fortunately for me, I spend at least a little of that time doing other things, like actually working on previously mentioned web design solutions. One area of interest that I’ve been getting more and more obsessed with is using Javascript to allow cross-browser CSS3 functionality on modern browsers, despite the fact that short of Konquerer, (which really annoys me because of the ‘cool’ spelling of a word with the letter K) browsers probably won’t be doing a lot of note with CSS3 until sometime after global warming causes the seas to rise and dolphins enslave humanity.

(more…)