I can’t spell, the browser can’t tell

December 10th, 2008 § 0

I spent about half an hour trying to figure out why this code wouldn’t do what I wanted it to do, which is just create a div element and position it at a specific coordinate in the page:

var contactInfoDiv = document.createElement('div');
m = $(linkStr).positionedOffset();
contactInfoDiv.style.cssText = "background-image: url('{{MEDIA_URL}}images/nav_pointer.png'); width: 29px; height: 16px;"
contactInfoDiv.style.cssText += "position: abolute; top: " + (m.top - 70) + "px; left: " + (m.left - 85) + "px;";

document.body.appendChild(contactInfoDiv);

Don’t know if you caught it or not, but position: abolute is actually supposed to be position: absolute.

Don’t you wish the browser was a bit more unforgiving? So, instead of having my code kinda-work, it would have choked telling me that abolute is not a recognized position, and it would have taken me 5 seconds to resolve the issue, instead of half an hour.

Or maybe, just maybe, I can learn to spell—yeah, not happening.

  • Share/Bookmark

Tagged: , ,

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

§ Leave a Reply

What's this?

You are currently reading I can’t spell, the browser can’t tell at life of a gizmo.

meta