<?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>dev.enekoalonso.com &#187; apple</title>
	<atom:link href="http://dev.enekoalonso.com/tag/apple/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.enekoalonso.com</link>
	<description>having fun with code</description>
	<lastBuildDate>Sat, 31 Jul 2010 05:51:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Safari 4 rocks</title>
		<link>http://dev.enekoalonso.com/2009/03/01/safari-4-rocks/</link>
		<comments>http://dev.enekoalonso.com/2009/03/01/safari-4-rocks/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 15:48:20 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=286</guid>
		<description><![CDATA[I&#8217;ve been using Safari both at home and work since last Thursday when I first knew it had been released and it looks very fast and solid. They have finally added some standard keyboard shortcuts, like Ctrl+Tab and now you can restore your previous session (all pages open) the next time you open the browser [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Safari both at home and work since last Thursday when I first knew it had been released and it looks very fast and solid. They have finally added some standard keyboard shortcuts, like Ctrl+Tab and now you can restore your previous session (all pages open) the next time you open the browser (although not automatically like Firefox).</p>
<p>It looks very good for web development too, since it has the Javascript console integrated and you can do direct changes on the DOM and the CSS to preview how it would look. But I think Firebug is still ahead and I&#8217;m very used to it, so I&#8217;m not ready to completely stop using Firefox.</p>
<p>I have nothing against Firefox, which has been my favorite browser for years, but the fact that it is very, very slow. I&#8217;ll say today is the slowest browser out there. Or at least it looks like that sometimes. The only extension I have is Firebug. I&#8217;ve tried removing the cache, the history, etc. with no luck.</p>
<p>So yeah, so far I&#8217;m very happy with Safari 4.</p>
<p><img class="aligncenter size-medium wp-image-287" title="Safari 4" src="http://dev.enekoalonso.com/wp-content/uploads/2009/03/picture-161-417x300.png" alt="Safari 4" width="417" height="300" /></p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>January 27, 2010 -- <a href="http://dev.enekoalonso.com/2010/01/27/detecting-when-css-gets-loaded-by-the-browser-with-mootools-and-asset-css/" title="Detecting when CSS gets loaded by the browser with Mootools and Asset.css">Detecting when CSS gets loaded by the browser with Mootools and Asset.css</a> (0)</li><li>July 30, 2010 -- <a href="http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/" title="Titanium Developer: love and hate">Titanium Developer: love and hate</a> (2)</li><li>June 30, 2009 -- <a href="http://dev.enekoalonso.com/2009/06/30/iphone-3-0-geolocation-with-javascript/" title="iPhone 3.0 geolocation with Javascript">iPhone 3.0 geolocation with Javascript</a> (1)</li><li>December 29, 2008 -- <a href="http://dev.enekoalonso.com/2008/12/29/modifying-the-url-hash-without-affecting-the-browser-history/" title="Modifying the URL Hash without affecting the browser history">Modifying the URL Hash without affecting the browser history</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2009/03/01/safari-4-rocks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Handling events on iPhone webapps</title>
		<link>http://dev.enekoalonso.com/2008/12/05/handling-events-on-iphone-webapps/</link>
		<comments>http://dev.enekoalonso.com/2008/12/05/handling-events-on-iphone-webapps/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 22:02:29 +0000</pubDate>
		<dc:creator>Eneko Alonso</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://dev.enekoalonso.com/?p=82</guid>
		<description><![CDATA[This week I have been working on a website for iPhone phones and I have discovered some interesting things about events. I am using plain Javascript, with no third party libraries, so I don&#8217;t know if they have any fix for these issues or if they affect them. For example, a couple of days ago [...]]]></description>
			<content:encoded><![CDATA[<p>This week I have been working on a website for iPhone phones and I have discovered some interesting things about events. I am using plain Javascript, with no third party libraries, so I don&#8217;t know if they have any fix for these issues or if they affect them.</p>
<p>For example, a couple of days ago I was posting <a href="http://dev.enekoalonso.com/2008/12/02/detecting-iphones-orientation/">how to detect the iPhone&#8217;s orientation</a>. The problem with the method I used is that I am assigning explicitly the function to handle the event, which means only that function will handle the event. If I wanted to add a second function to handle the same event, for example inside an object, I would have to use the window.addEventListener method. But apparently <strong>addEventListener does not work on the iPhone for some events</strong>.</p>
<p>The following code wont work on the iPhone (although it works on the iPhone simulator)</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">function</span> updateLayout<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>window.<span class="me1">orientation</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; document.<span class="me1">body</span>.<span class="me1">setAttribute</span><span class="br0">&#40;</span><span class="st0">&#39;class&#39;</span>, <span class="st0">&#39;landscape&#39;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; document.<span class="me1">body</span>.<span class="me1">setAttribute</span><span class="br0">&#40;</span><span class="st0">&#39;class&#39;</span>, <span class="st0">&#39;portrait&#39;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">window.<span class="me1">addEventListener</span><span class="br0">&#40;</span><span class="st0">&#39;orientationchange&#39;</span>, <span class="kw2">function</span><span class="br0">&#40;</span>event<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; updateLayout<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span>, <span class="kw2">false</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">window.<span class="me1">addEventListener</span><span class="br0">&#40;</span><span class="st0">&#39;load&#39;</span>, <span class="kw2">function</span><span class="br0">&#40;</span>event<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; updateLayout<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span>, <span class="kw2">false</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>I have found the addEventListener function works with input fields (focus and blur events), with links (click event) and with window (load event). I have found it doesn&#8217;t work on forms (submit event) neither with the custom onorientationchange event as shown avobe. I haven&#8217;t tested other events yet.</p>
<p>It may be that all these issues have been fixed in newer versions of the iPhone OS X &#8211; the one I have for testing is 1.1.4 (4A102).</p>
<h3  class="related_post_title">Related Posts:</h3><ul class="related_post"><li>July 30, 2010 -- <a href="http://dev.enekoalonso.com/2010/07/30/titanium-developer-love-and-hate/" title="Titanium Developer: love and hate">Titanium Developer: love and hate</a> (2)</li><li>March 24, 2010 -- <a href="http://dev.enekoalonso.com/2010/03/24/mooml-1-1-no-more-eval-say-hi-to-mooml-template-and-mooml-templates/" title="Mooml 1.1 &#8211; No more eval(), say Hi to Mooml.Template and Mooml.Templates">Mooml 1.1 &#8211; No more eval(), say Hi to Mooml.Template and Mooml.Templates</a> (0)</li><li>January 28, 2010 -- <a href="http://dev.enekoalonso.com/2010/01/28/things-to-do/" title="Things to do">Things to do</a> (0)</li><li>September 2, 2009 -- <a href="http://dev.enekoalonso.com/2009/09/02/creating-html-blocks-with-mootools/" title="Creating HTML blocks with Mootools">Creating HTML blocks with Mootools</a> (3)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://dev.enekoalonso.com/2008/12/05/handling-events-on-iphone-webapps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
