<?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>artlayer.com &#187; iPhone</title>
	<atom:link href="http://www.artlayer.com/category/iphone/feed" rel="self" type="application/rss+xml" />
	<link>http://www.artlayer.com</link>
	<description>A Blog about Design, Web, Front-End Development, Photography, Music and some rants about meaningless subjects.</description>
	<lastBuildDate>Tue, 31 Jan 2012 11:31:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Safari Mobile breaks jquery.live()</title>
		<link>http://www.artlayer.com/safari-mobile-breaks-jquery-live</link>
		<comments>http://www.artlayer.com/safari-mobile-breaks-jquery-live#comments</comments>
		<pubDate>Wed, 31 Aug 2011 00:16:30 +0000</pubDate>
		<dc:creator>Nelson Mendes</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.artlayer.com/?p=128</guid>
		<description><![CDATA[The live() method of jQuery is a blessing for dynamic interfaces. It allows you to attach events to dynamically created elements. Say you want to create a dynamic menu based on some live data read from a server. Maybe you want to create some HTML like this: With jQuery you can dynamically generate clickable elements [...]]]></description>
			<content:encoded><![CDATA[<p>The live() method of jQuery is a blessing for dynamic interfaces. It allows you to attach events to dynamically created elements.</p>
<p>Say you want to create a dynamic menu based on some live data read from a server. Maybe you want to create some HTML like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;nav&gt;
&lt;ul&gt;
	&lt;li id=&quot;nav1&quot; class=&quot;btn&quot;&gt;item1&lt;/li&gt;
	&lt;li id=&quot;nav2&quot; class=&quot;btn&quot;&gt;item1&lt;/li&gt;
	&lt;li id=&quot;nav3&quot; class=&quot;btn&quot;&gt;item1&lt;/li&gt;
	&lt;li id=&quot;nav4&quot; class=&quot;btn&quot;&gt;item1&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
</pre>
<p>With jQuery you can dynamically generate clickable elements like this:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;.btn&quot;).live(&quot;click&quot;, function(){
var elem = event.target.id;
alert(&quot;you clicked: &quot; + elem);
});
</pre>
<p>This works well in the desktop and in every browser but on Mobile Safari it fails.</p>
<p>A workaround is to deliberately add an &#8220;onclick&#8221; attribute to the element you want to attach the event:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;ul&gt;
	&lt;li id=&quot;nav1&quot; class=&quot;btn&quot; onclick=&quot;&quot;&gt;item1&lt;/li&gt;
&lt;/ul&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.artlayer.com/safari-mobile-breaks-jquery-live/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frank Miller&#8217;s iPhone Cases</title>
		<link>http://www.artlayer.com/53</link>
		<comments>http://www.artlayer.com/53#comments</comments>
		<pubDate>Thu, 25 Feb 2010 19:03:10 +0000</pubDate>
		<dc:creator>Nelson Mendes</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Illustration]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[comics]]></category>

		<guid isPermaLink="false">http://www.artlayer.com/2010/02/25/53/</guid>
		<description><![CDATA[Gorgeous iphone case from one my favorite comics illustrator, Frank Miller. This one is from Sin City, but there&#8217;s also one from 300 AFAIK.]]></description>
			<content:encoded><![CDATA[<div class="wp-caption aligncenter" style="width: 571px"><img alt="Frank Miller&#039;s Sin City Iphone Case" src="http://emberapp.com/zyon/images/frank-millers-sin-city-iphone-case/sizes/m.png" title="Frank Miller&#039;s Iphone Cases" width="561" height="536" /><p class="wp-caption-text">Frank Miller&#039;s Sin City Iphone Case</p></div>
<p>Gorgeous iphone case from one my favorite comics illustrator, <a href="http://en.wikipedia.org/wiki/Frank_Miller_%28comics%29">Frank Miller</a>. This one is from Sin City, but there&#8217;s also one from 300 AFAIK.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.artlayer.com/53/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

