<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Prototype.js, setStyle, and IE not working together</title>
	<atom:link href="http://www.nutt.net/2010/04/02/prototype-js-setstyle-and-ie-not-working-together/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nutt.net/2010/04/02/prototype-js-setstyle-and-ie-not-working-together/</link>
	<description>Random articles on whatever I feel like...</description>
	<lastBuildDate>Tue, 07 Feb 2012 22:30:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: npup</title>
		<link>http://www.nutt.net/2010/04/02/prototype-js-setstyle-and-ie-not-working-together/comment-page-1/#comment-116611</link>
		<dc:creator>npup</dc:creator>
		<pubDate>Fri, 22 Oct 2010 10:39:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.nutt.net/?p=543#comment-116611</guid>
		<description>When creating DOM elements one can as well use Prototype&#039;s functions for it and get the extension from the start, even in IE, and set most of the stuff in one fell swoop:
&lt;code&gt;
var brDiv = new Element(&#039;div&#039;, {id: &#039;cool_container&#039;, className: &#039;class0 class1&#039;}).setStyle({backgroundColor: &#039;black&#039;, position: &#039;absolute&#039;}); // it is extended from birth
&lt;/code&gt;

One semi-semi-related thing that happened to me recently was that all elements on the page seemed to be unextended on a page in IE. The source of the problem was that prototype.js was being included twice on the page. It blew IE away - not sure why yet. But there is some special stuff about extending the elements in IE for sure.

/@npup</description>
		<content:encoded><![CDATA[<p>When creating DOM elements one can as well use Prototype&#8217;s functions for it and get the extension from the start, even in IE, and set most of the stuff in one fell swoop:<br />
<code><br />
var brDiv = new Element('div', {id: 'cool_container', className: 'class0 class1'}).setStyle({backgroundColor: 'black', position: 'absolute'}); // it is extended from birth<br />
</code></p>
<p>One semi-semi-related thing that happened to me recently was that all elements on the page seemed to be unextended on a page in IE. The source of the problem was that prototype.js was being included twice on the page. It blew IE away &#8211; not sure why yet. But there is some special stuff about extending the elements in IE for sure.</p>
<p>/@npup</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.nutt.net/2010/04/02/prototype-js-setstyle-and-ie-not-working-together/comment-page-1/#comment-104161</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Tue, 15 Jun 2010 16:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.nutt.net/?p=543#comment-104161</guid>
		<description>Prototype has to extend elements before you can call the new methods on them.  When you dynamically create a div, it won&#039;t yet be extended.  You can use prototype&#039;s $() function to quickly extend a new element.

var brDiv = $(document.createElement(&#039;div&#039;));

brDiv.setStyle({ backgroundColor: &#039;black&#039;, position: &#039;absolute&#039;});</description>
		<content:encoded><![CDATA[<p>Prototype has to extend elements before you can call the new methods on them.  When you dynamically create a div, it won&#8217;t yet be extended.  You can use prototype&#8217;s $() function to quickly extend a new element.</p>
<p>var brDiv = $(document.createElement(&#8216;div&#8217;));</p>
<p>brDiv.setStyle({ backgroundColor: &#8216;black&#8217;, position: &#8216;absolute&#8217;});</p>
]]></content:encoded>
	</item>
</channel>
</rss>

