<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oliver Nassar &#187; browser</title>
	<atom:link href="http://www.olivernassar.com/tag/browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.olivernassar.com</link>
	<description>Making the interwebs.</description>
	<lastBuildDate>Thu, 12 Nov 2009 22:17:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>grabbing an attribute in mootools: .[name] or .get or .retrieve or .getProperty?</title>
		<link>http://www.olivernassar.com/2009/11/01/grabbing-an-attribute-in-mootools-name-or-get-or-retrieve-or-getproperty/</link>
		<comments>http://www.olivernassar.com/2009/11/01/grabbing-an-attribute-in-mootools-name-or-get-or-retrieve-or-getproperty/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 22:56:06 +0000</pubDate>
		<dc:creator>onassar</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[xhtml]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[dom node]]></category>
		<category><![CDATA[ff]]></category>
		<category><![CDATA[href]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[property]]></category>

		<guid isPermaLink="false">http://www.olivernassar.com/?p=278</guid>
		<description><![CDATA[<a href="http://www.olivernassar.com/2009/11/01/grabbing-an-attribute-in-mootools-name-or-get-or-retrieve-or-getproperty/" rel="attachment wp-att-121"><img src="http://www.olivernassar.com/wp-content/uploads/2009/08/mootools_logo1-150x150.jpg" alt="mootools_logo" title="mootools_logo" width="150" height="150" class="alignleft size-thumbnail wp-image-121" /></a>Something I ran into just now was returning an anchor's attribute consistently across browsers. So I have an anchor with an address like '/users/delete/5/' which does what you'd think it does. But I ran into an inconsistent return response in (you guessed it) ie6. In all fairness, it might not be IE6's fault, but it speaks more to a problem with mootools. While it is a nearly perfect library/framework, this does bug me.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.olivernassar.com/wp-content/uploads/2009/08/mootools_logo1-150x150.jpg" alt="mootools_logo" title="mootools_logo" width="150" height="150" class="alignleft size-thumbnail wp-image-121" />Something I ran into just now was returning an anchor&#8217;s attribute consistently across browsers. So I have an anchor with an address like &#8216;/users/delete/5/&#8217; which does what you&#8217;d think it does. But I ran into an inconsistent return response in (you guessed it) ie6. In all fairness, it might not be IE6&#8217;s fault, but it speaks more to a problem with mootools. While it is a nearly perfect library/framework, this does bug me.</p>
<p>Mootools has 3 native methods for accessing an attribute/property for a node (which in the DOM, often overlaps). .get(&#8217;name&#8217;), .retrieve(&#8217;name&#8217;), and getProperty(&#8217;name&#8217;). While they are all meant to do things a little differently (eg. set an attribute for a node, store a data object in an existing object (which could be a DOM node) or store a property in an object (which again, could be a DOM node), they seem to overlap a lot.</p>
<p>So I have this anchor, and when I tried accessing it (grabbing the href) using the accessors I have, here at the results for FF (mac) vs. IE6 (windows):</p>
<p>.[name]<br />
FF: full path including host<br />
IE6: full path including host</p>
<p>.get<br />
FF: request path (excluding host)<br />
IE6: full path including host</p>
<p>.retrieve<br />
FF: null<br />
IE6: null</p>
<p>.getProperty<br />
FF: request path (excluding host)<br />
IE6: full path including host</p>
<p>Now it&#8217;s hard to say what is the correct expectation. I&#8217;m sure I could figure it out in the eyes of the W3C, but rather, here&#8217;s what I&#8217;ve noticed. Both browsers take whatever path is specified and render it internally with the host. I understand this since it&#8217;s what the browser would need to actually make a full request.</p>
<p>The 2nd and 4th accessors, though, are inconsistent and cause problems since their expected results different. IE6 includes the full path &#038; host each time which is most likely an issue with how it accesses it. When the browser defines the href in memory it must overwrite the local pointer which then can&#8217;t be accessed properly.</p>
<p>So what do I do about this? Nothing really. I have this documented now so that if there is a pre-dom-ready source that I need to inspect (for example, href values written but no rendered after the dom has been loaded), I should be using the .[name] accessor, and make adjustments accordingly based on what is being accessed (in this case the href which has the host prepended).</p>
<p>These differences really suck since they introduce inconsistencies in places where you wouldn&#8217;t expect them and thus break applications/scripts (like what drove me to discover this). I would hope a framework/library would help mitigate this kind of thing, but alas, they can&#8217;t do everything, and I&#8217;m just happy for what they do bring to the table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.olivernassar.com/2009/11/01/grabbing-an-attribute-in-mootools-name-or-get-or-retrieve-or-getproperty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
