alanwilliamson

Safari Dom Exception 5 - setAttribute() gotcha

I just hit up against a little gotcha with the Safari browser for Apple.  People had been complaining they couldn't comment on our blogs from Safari and I was pulling my hair out trying to figure out why.  After a VNC session with a Safari browser, finally got to the bottom of it.  (thank you Andy for lending me your Mini!)

If you are setting custom attributes on a DOM object, then Safari doesn't like them starting with an (_) underscore.

So instead:

    div.setAttribute( "_contentloaded", "1" );

change to: 

    div.setAttribute( "contentloaded", "1" );

Interestingly though, it is more than happy to read attributes beginning with an underscore if already present in the DOM, just coughs with a very descriptive "Dom Exception 5" error.  Because it was reading the attributes fine enough, it took a little debugging to find this one. 

Comments

Awesome - thanks Alan!

left by Jonathan Aquino — Friday, 11 May 2007 11:10 PM — web site

Leave Comment

please note, all comments will be moderated for spam and abuse before being publicly posted.


 

Recent Cloud posts

Recent JAVA posts

Latest CFML posts


 
Site Links
Recommended Sites/Blogs