{"id":60,"date":"2007-04-15T14:10:22","date_gmt":"2007-04-15T18:10:22","guid":{"rendered":"http:\/\/whoisgregg.com\/blog\/2007\/04\/prototype-internet-explorer-gotchas.html"},"modified":"2007-04-15T14:10:22","modified_gmt":"2007-04-15T18:10:22","slug":"prototype-internet-explorer-gotchas","status":"publish","type":"post","link":"http:\/\/www.whoisgregg.com\/blog\/2007\/04\/prototype-internet-explorer-gotchas\/","title":{"rendered":"Prototype Internet Explorer Gotchas"},"content":{"rendered":"<p>One week into building a technology preview for a new web application, I finally decided to check and &#8220;just make sure&#8221; that everything was working as well in Windows Internet Explorer as it was working in Safari and Firefox. Imagine my chagrin when the page loaded and was __completely blank__.<\/p>\n<p>Not even a joyous error message or self-destruct error report to pore over for clues. Just a blank screen. Nothing. Nada. <\/p>\n<p>First some background&#8230; I&#8217;m building the client side of the in Javascript using the amazing [Prototype](http:\/\/www.prototypejs.org\/) and [Scriptaculous](http:\/\/script.aculo.us\/) libraries.<\/p>\n<p>It turns out that there are two **very** important things to keep in mind for Internet Explorer. First, `Element.extend` is your friend when adding to the DOM. Example:<\/p>\n<p>`var my_div = document.createElement(&#8216;div&#8217;);<br \/>\nElement.extend(my_div); \/\/ without this line, the next line causes IE to stop processing the script!<br \/>\nmy_div.addClassName(&#8216;thumbnail&#8217;);<br \/>\n`<\/p>\n<p>Second, be careful what you use as names for custom attributes! If you inadvertently [cross the streams](http:\/\/en.wikipedia.org\/wiki\/Proton_Pack#Crossing_the_Streams) by using form attributes on non-form elements then Internet Explorer will suffer total protonic reversal (or, in other words, forcibly shut down). Example:<\/p>\n<p>`var my_li = document.createElement(&#8216;li&#8217;);<br \/>\nElement.extend(my_li);<br \/>\nmy_li.setAttribute(&#8216;value&#8217;, s.id); \/\/ IE self-destructs<br \/>\nmy_li.setAttribute(&#8216;valuetest&#8217;, s.id); \/\/ IE works fine<br \/>\n`<\/p>\n<p>Although there is little else I can share about the application I am working on, suffice it to say in about, oh, six months I should have both good news to share and a fantastic grasp on Javascript programming. :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One week into building a technology preview for a new web application, I finally decided to check and &#8220;just make sure&#8221; that everything was working as well in Windows Internet Explorer as it was working in Safari and Firefox. Imagine my chagrin when the page loaded and was __completely blank__. Not even a joyous error&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[],"_links":{"self":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/posts\/60"}],"collection":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":0,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}