<?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>notwithoutmycode</title>
	<atom:link href="http://www.notwithoutmycode.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.notwithoutmycode.com</link>
	<description>a blog about web development</description>
	<lastBuildDate>Fri, 03 Sep 2010 09:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Documenting your Flash IDE project with ASDoc</title>
		<link>http://www.notwithoutmycode.com/2010/09/03/documenting-your-flash-ide-project-with-asdoc/</link>
		<comments>http://www.notwithoutmycode.com/2010/09/03/documenting-your-flash-ide-project-with-asdoc/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 09:47:02 +0000</pubDate>
		<dc:creator>Sergio</dc:creator>
				<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://www.notwithoutmycode.com/?p=160</guid>
		<description><![CDATA[So, you want to generate some documentation for your project? I&#8217;ve found two great options: NaturalDocs and ASDoc. NaturalDocs is very nice and it supports a wide variety of languages. However I didn&#8217;t like how it documented inherited properties and methods. I then turned to ASDoc. ASDoc is part of the Flex SDK, and it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>So, you want to generate some documentation for your project?</p>
<p>I&#8217;ve found two great options: <a href="http://www.naturaldocs.org/">NaturalDocs</a> and <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html">ASDoc</a>.</p>
<p>NaturalDocs is very nice and it supports a wide variety of languages. However I didn&#8217;t like how it documented inherited properties and methods.</p>
<p>I then turned to ASDoc. ASDoc is part of the Flex SDK, and it&#8217;s what the big guys at Adobe use.</p>
<p>Documenting Flex projects is &#8220;easy&#8221;. However there&#8217;s not too much documentation around for using ASDoc with the Flash IDE. I had a hard time making it work the first time I tried it, so here&#8217;s a list of tips I&#8217;d like to share to make your ASDoc experience less painful.</p>
<p>First of all, there&#8217;s running the ASDoc command. While you can <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_9.html">run the asdoc command through the console</a>, write a shell script or a rake task, I recommend <a href="http://www.gskinner.com/blog/archives/2010/05/asdocr_update_f_1.html">ASDocr</a>. ASDocr gives you a nice GUI to run the command. You just need to point the location of the asdoc command and the sourche path of your project and your are ready to go.</p>
<p>Is very unlikely you&#8217;ll succeed the first time. Why? ASDoc fails if it find errors in your code, that includes all of those classes that are not being compiled (and thus the Flash IDE doesn&#8217;t wanr you). So take all those files out and try it again.</p>
<p>Second is dependencies. The Flash IDE creates a lot of stuff on the background so you don&#8217;t have to care for it. Remember the &#8220;A definition for this class could not be found in the classpath, so one will be automatically generated in the SWF file upon export&#8221; message? Well, ASDoc will look for those classes but they won&#8217;t be on your classpath, so it fails. The solution, create a class for every one of the symbols you export for Actionscript.</p>
<p>You also have to deal with symbols with instance names. Normally you can access these symbols in your class by using the instance name. The Flash IDE creates a property inside your object so the symbol can be fetched from that property. That&#8217;s why you can&#8217;t have a method and a symbol with the same name/instance.  ASDoc doesn&#8217;t know about these magic properties and fails. To solve this issue use getChildByName instead.</p>
<pre class="brush: as3;">
this.my_symbol_instance_name //change this
this.getChildByName(&quot;my_symbol_instance_name&quot;) //to this
</pre>
<p>I usually name symbols on the stage with an appended underscore (_my_symbol_instance_name) and save into a private variable (private var my_symbol_instance_name:DisplayObject).</p>
<p>It&#8217;s important to know that getChildByName will throw an error if it doesn&#8217;t find a symbol, so you&#8217;ll want to wrap it inside a try&#8230;catch..finally block then.</p>
<p>And finally comes the libraries. ASDoc only recognizes .swc files or directories containing .swc files as the library-path. Use the .swc packaged version of your libraries (if available) or create your own. Creating .swc files with the Flash IDE is a little bit tricky too, take a look <a href="http://www.luaye.com/blog/index.php?action=read&amp;id=54">here</a> for more information.</p>
<p>I haven&#8217;t found any more things preventing my code from bein documented with ASDoc, if you find anything else feel free to comment. I also haven&#8217;t been able to run ASDoc with the FLVPlayer component, I use the wildcard so it doesn&#8217;t look for the class definition.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notwithoutmycode.com/2010/09/03/documenting-your-flash-ide-project-with-asdoc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making AS3 more dynamic with Objects</title>
		<link>http://www.notwithoutmycode.com/2010/05/16/making-as3-more-dynamic-with-objects/</link>
		<comments>http://www.notwithoutmycode.com/2010/05/16/making-as3-more-dynamic-with-objects/#comments</comments>
		<pubDate>Sun, 16 May 2010 11:40:17 +0000</pubDate>
		<dc:creator>Sergio</dc:creator>
				<category><![CDATA[AS3]]></category>

		<guid isPermaLink="false">http://www.angryloop.net/blog/?p=81</guid>
		<description><![CDATA[I love AS3. However after some time working with Javascript, I&#8217;ve come  to miss the versatility of AS2 dynamic typing. Don&#8217;t get me wrong, AS3  strong typing is great, and the compile time errors save tons of  debugging hours. But sometimes strong typing can lead to multiple  functions that do the same thing, just because [...]]]></description>
			<content:encoded><![CDATA[<p>I love AS3. However after some time working with Javascript, I&#8217;ve come  to miss the versatility of AS2 dynamic typing. Don&#8217;t get me wrong, AS3  strong typing is great, and the compile time errors save tons of  debugging hours. But sometimes strong typing can lead to multiple  functions that do the same thing, just because one argument type is  different.﻿</p>
<p>Some languages, like Java, support multiple method signatures. AS3 doesn&#8217;t, but the guys at Adobe do something similar with methods like String.replace, where the last argument can be either a String or a Function. They do it giving the second argument an Object type. Yes, the core Object class. Everybody knows how this class works, but with all the cool features of AS3 we tend to forget it. For example, to emulate the String.replace behavior we can do something like this.</p>
<pre class="brush: as3;">
function replace(pattern:*, repl:Object):String{
  if(repl is String)
    // do something when repl is a String
  else if(repl is Function)
    // do something when repl is a Function
  else
    throw(new Error(&quot;The second argument of String has to be either a String or a Function&quot;));
}
</pre>
<p>I don&#8217;t remember where I read that using <em>is</em> to test type casting is faster than doing something like&#8230;</p>
<pre class="brush: as3;">
String(my_string) != null
</pre>
<p>&#8230; is slower than <em>is</em>, I don&#8217;t know if it&#8217;s true but I do it. Altough <em>is</em> sometimes behaves oddly.</p>
<p>For parameters or options we can also use hasOwnProperty to test if a parameter has been set like this:</p>
<pre class="brush: as3;">
function modify_image(img:*, params:Object = null):void{
  if(!params) params = {width: 99}; //set default values if no parameters given
  else { // verify if the params object has all the necessary parameters for the method to work
    if(!params.hasOwnProperty(&quot;width&quot;)) params.width = 99;
   }
   // do something
}</pre>
<p>Also lets not forget AS&#8217; Javascript inheritance. We can use method closures and the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/statements.html#..._(rest)_parameter">&#8230;(rest)</a> parameter (similar to Javascript&#8217;s argument variable).</p>
<p>I personally use these kind of techniques with helper or configuration classes. These kind of classes focus on one task and so they are easier to test; unlike interactive components, where more robust code is preferable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notwithoutmycode.com/2010/05/16/making-as3-more-dynamic-with-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery.slidingTabs animated tabs that load content via Ajax</title>
		<link>http://www.notwithoutmycode.com/2010/05/16/jquery-slidingtabs-animated-tabs-that-loads-dinamic-content-via-ajax/</link>
		<comments>http://www.notwithoutmycode.com/2010/05/16/jquery-slidingtabs-animated-tabs-that-loads-dinamic-content-via-ajax/#comments</comments>
		<pubDate>Sun, 16 May 2010 00:55:27 +0000</pubDate>
		<dc:creator>Javier</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.angryloop.net/blog/?p=3</guid>
		<description><![CDATA[With jquery.slidingTabs you can create unobtrusive carousel-style tabs that load dynamic content via Ajax. Tested with jQuery 1.3.2 and 1.4.2 in Internet Explorer 6-8, Firefox 2-3.6, Safari 4, Chrome. Download Source (5.1Kb), Minified  (2.8kb). Follow the project on GitHub or report a issue! View examples in a new page Examples Seu browser não suporta iframes. [...]]]></description>
			<content:encoded><![CDATA[<p>With jquery.slidingTabs you can create unobtrusive carousel-style tabs that load dynamic content via Ajax.</p>
<ul>
<li>Tested with jQuery 1.3.2 and 1.4.2 in Internet Explorer 6-8, Firefox 2-3.6, Safari 4, Chrome.</li>
<li>Download <a href="http://github.com/vieron/jquery.slidingTabs/zipball/master" target="_blank">Source</a> (5.1Kb), Minified  (2.8kb).</li>
<li>Follow the project on <a href="http://github.com/vieron/jquery.slidingTabs" target="_blank">GitHub</a> or <a href="http://github.com/vieron/jquery.slidingTabs/issues" target="_blank">report a issue!</a></li>
<li>View examples in a <a href="http://www.notwithoutmycode.com/examples/jquery.slidingTabs/index.html">new page</a></li>
</ul>
<h3>Examples</h3>
<p><iframe   src="http://www.notwithoutmycode.com/examples/jquery.slidingTabs/index.html"   height="340px" width="100%" frameborder="0"  >Seu browser não suporta iframes.</iframe></p>
<h3>Usage</h3>
<p>First you need to download the <a href="http://code.jquery.com/jquery-1.4.2.min.js" target="_blank">jquery</a> and <a href="http://github.com/vieron/jquery.slidingTabs/zipball/master">jquery.slidingTabs</a> source. Include them inside the  tag &lt;head&gt; of your document:</p>
<pre class="brush: xml;">
&lt;script src=&quot;javascripts/jquery.1.4.2.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;javascripts/jquery.slidingTabs.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
</pre>
<p>Then write some HTML like this:</p>
<pre class="brush: xml; collapse: true; light: false; toolbar: true;">
&lt;div class=&quot;multi_tabs&quot;&gt;
    &lt;div class=&quot;menu&quot;&gt;
      &lt;ul&gt;
        &lt;li class=&quot;active&quot;&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 1&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 2&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 3&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 4&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 5&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 6&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 7&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 8&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 9&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 10&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 11&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 12&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 13&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;ajaxcontent.html&quot;&gt;TAB 14&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;&lt;!-- .menu --&gt;
    &lt;div class=&quot;cont_tabs&quot;&gt;
      &lt;div&gt;
        First content
      &lt;/div&gt;
    &lt;/div&gt;&lt;!-- cont_tabs --&gt;
  &lt;/div&gt;&lt;!-- multitabs --&gt;
</pre>
<p>&#8230;some styles. Note that a few basic styles are required for plugin works.</p>
<pre class="brush: css; collapse: true; light: false; toolbar: true;">
/*GENERAL STYLES*/
  * {
    margin:0;
    padding:0;
  }

  /*COMMON STYLES FOR TABS*/

  .multi_tabs {
    width:600px;
  }

  .multi_tabs .menu {
    overflow:hidden;
    position:relative;
    z-index:10;
    width:100%;
  }

  .multi_tabs ul {
    overflow:hidden;
    position:relative;
    width:9000px;
  }

  .multi_tabs ul li{
    float:left;
    display:inline;
    padding:6px 8px 4px 8px;
  }

  .multi_tabs ul li.active{
    background:#CCC;
  }

  .multi_tabs ul li a{
    display:inline;
  }

  .multi_tabs ul li.active a{
    color:#000;
  }

  .multi_tabs .cont_tabs{
    clear:both;
  }

  .multi_tabs .next,
  .multi_tabs .prev{
    position:absolute;
    display:block;
    top:0;
    width:24px;
    height:29px;
    background: #E4E4E4;
    z-index:100;
  }

  .multi_tabs .prev{
    left:0;
  }

  .multi_tabs .next{
    right:0;
  }

  .multi_tabs .accessible {
    display:none;
  }
</pre>
<p>And invoke the plugin:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
    $(function(){
      $('.multi_tabs').slidingTabs({
          tabs: '.menu',
          content : '.cont_tabs'
       });
    })
  &lt;/script&gt;
</pre>
<h3>Configuration</h3>
<table class="properties">
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Default value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>tabs</td>
<td>string</td>
<td>&#8216;.menu&#8217;</td>
<td>selector for tabs wrapper.</td>
</tr>
<tr>
<td>content</td>
<td>string</td>
<td>&#8216;.cont_tabs&#8217;</td>
<td>selector for content wrapper (where the content loaded via ajax goes in).</td>
</tr>
<tr>
<td>diff_widths</td>
<td>boolean</td>
<td>true</td>
<td>if the tabs have equal widths set <strong>diff_widths</strong> to <strong>false</strong>, for performance issues.</td>
</tr>
<tr>
<td>offset_x</td>
<td>number</td>
<td>3</td>
<td>offset in x for tabs.</td>
</tr>
<tr>
<td>displacement</td>
<td>number</td>
<td>200</td>
<td>how many pixels the tabs will be animated.</td>
</tr>
<tr>
<td>requestType</td>
<td>string</td>
<td>&#8216;GET&#8217;</td>
<td>type of the Ajax request.</td>
</tr>
<tr>
<td>hiddenClass</td>
<td>string</td>
<td>&#8216;accessible&#8217;</td>
<td>class added to next and prev elements when there are more tabs to show.</td>
</tr>
<tr>
<td>next_txt</td>
<td>string</td>
<td>&#8216;Next&#8217;</td>
<td>next element text.</td>
</tr>
<tr>
<td>prev_txt</td>
<td>string</td>
<td>&#8216;Previous&#8217;</td>
<td>prev element text.</td>
</tr>
<tr>
<td>fadeIn_duration</td>
<td>number os string</td>
<td>&#8216;slow&#8217;</td>
<td>duration in milliseconds of the fadeIn when ajax loaded content is shown.</td>
</tr>
<tr>
<td>fadeOut_duration</td>
<td>number or string</td>
<td>&#8216;normal&#8217;</td>
<td>duration in milliseconds of the fadeOut when content is hidden.</td>
</tr>
<tr>
<td>animationSpeed</td>
<td>number</td>
<td>500</td>
<td>speed for the animation of the tabs.</td>
</tr>
<tr>
<td>onSuccessCallback</td>
<td>function</td>
<td>function($wrap, $tabs_links, content){}</td>
<td>function invoked when content is successfully loaded.</td>
</tr>
<tr>
<td>onFadeInCallback</td>
<td>function</td>
<td>function($wrap, $tabs_links, content){}</td>
<td>function invoked when fadeIn effect ends.</td>
</tr>
<tr>
<td>onFadeOutCallback</td>
<td>function</td>
<td>function($wrap, $tabs_links, content){}</td>
<td>function invoked when fadeOut effect ends.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.notwithoutmycode.com/2010/05/16/jquery-slidingtabs-animated-tabs-that-loads-dinamic-content-via-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Painless Facebook development with rsync</title>
		<link>http://www.notwithoutmycode.com/2010/04/01/painless-facebook-development-with-rsync/</link>
		<comments>http://www.notwithoutmycode.com/2010/04/01/painless-facebook-development-with-rsync/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 14:21:26 +0000</pubDate>
		<dc:creator>Sergio</dc:creator>
				<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.angryloop.net/blog/?p=111</guid>
		<description><![CDATA[Lately I&#8217;ve been involved in developing applications for the Facebook Platform. The Facebook API is great, but the documentation is very out of date. The new Graph API seems to simplify a lot of things, and is very well documented in comparison to the old REST API. However testing your apps locally is still very [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been involved in developing applications for the Facebook  Platform. <span style="text-decoration: line-through;">The Facebook API is great, but the documentation is very out  of date.</span> The new Graph API seems to simplify a lot of things, and is very well documented in comparison to the old REST API. However testing your apps locally is still very annoying.</p>
<p>After long sessions of FTP uploading a friend of mine recommended rsync to me and my life has been much better since then. Rsync is a software for UNIX to synchronizes files and directories. With rsync and the help of SSH you can sinchronize both your local and remote directories in no time, leveraging the time it takes for you to watch the changes.</p>
<p>Just add this line of code to your bash profile and you are ready to go.</p>
<pre class="brush: bash;">alias sync_fb='rsync -zrptL --delete-after -e &quot;ssh&quot; --exclude=.DS_Store --exclude=.git --cvs-exclude local_directory_path username@domain:remote_directory_path'</pre>
<p>Just type sync_fb on your Terminal and you&#8217;ll se how the changes reflect on your remote directory in no time. Of course you can change the name of the task and create as many tasks as you want.  The &#8211;exclude=.DS_Store and &#8211;exclude=.git parameters are for mac and git users. If you are not a mac or git user, you can delete those. Also if you have public SSH keys set, you won&#8217;t even notice you are &#8220;pushing&#8221; to a remote directory.</p>
<p>For Textmate users there&#8217;s a bundle written by <a href="http://blog.nevercraft.net/">Joshua Priddle</a>, which let&#8217;s you synch your directories with a simple keyboard shortcut.  You can read more about it <a href="http://blog.nevercraft.net/projects/tm-rsync.html">here</a>. I tested it and I think it&#8217;s great. Not only it has all the benefits of rsync, but it also nicely outputs errors and a list of synched files in a new file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notwithoutmycode.com/2010/04/01/painless-facebook-development-with-rsync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery.flexipage</title>
		<link>http://www.notwithoutmycode.com/2009/12/05/flexipage-un-plugin-de-jquery-para-paginar-contenido/</link>
		<comments>http://www.notwithoutmycode.com/2009/12/05/flexipage-un-plugin-de-jquery-para-paginar-contenido/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 13:37:34 +0000</pubDate>
		<dc:creator>Javier</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://vieron.net/blog/?p=73</guid>
		<description><![CDATA[Hacia tiempo que tenia ganas de hacer un plugin de jquery. Me surgió la necesidad de hacer uno para un proyecto , así que mate dos pájaros de un tiro. Flexipage es un plugin de jquery que permite paginar elementos HTML. He hecho una humilde paginilla con ejemplos y “documentación“  la podéis ver aquí. descargar [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://vieron.net/blog/wp-content/uploads/2009/12/flexipagelogo.png"><img class="alignnone size-full wp-image-93" title="flexipagelogo" src="http://vieron.net/blog/wp-content/uploads/2009/12/flexipagelogo.png" alt="" width="209" height="63" /></a></p>
<p>Hacia tiempo que tenia ganas de hacer un plugin de jquery. Me surgió la necesidad de hacer uno para un proyecto , así que mate dos pájaros de un tiro.</p>
<p>Flexipage es un plugin de jquery que permite paginar elementos HTML.</p>
<p>He hecho una humilde paginilla con ejemplos y “documentación“  la podéis ver <a title="jquery flexipage" href="http://flexipage.vieron.net">aquí</a>.</p>
<p><a class="download" href="http://github.com/vieron/flexipage/zipball/master">descargar</a></p>
<p><a class="examples" href="http://flexipage.vieron.net/">ver ejemplos</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.notwithoutmycode.com/2009/12/05/flexipage-un-plugin-de-jquery-para-paginar-contenido/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>doctypes &amp; MIME-types</title>
		<link>http://www.notwithoutmycode.com/2009/07/23/hello-world-2/</link>
		<comments>http://www.notwithoutmycode.com/2009/07/23/hello-world-2/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 19:37:32 +0000</pubDate>
		<dc:creator>Javier</dc:creator>
				<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://vieron.net/blog/?p=1</guid>
		<description><![CDATA[Me entero leyendo JavasScript &#38; CSS Development with jQuery, que si usamos el doctype XHTML 1 Transitional XHTML 1.1 deberiamos declarar bien el tipo de archivo que se va a servir , en este caso application/xhtml+xml según recomienda la W3C. Si hacemos esto tenemos varios problemas: Debemos ser muy disciplinados creando el marcado y mas [...]]]></description>
			<content:encoded><![CDATA[<p>Me entero leyendo <em>JavasScript &amp; CSS Development with jQuery,</em> que si usamos el doctype <span style="text-decoration: line-through;">XHTML 1 Transitional</span> XHTML 1.1 deberiamos declarar bien el tipo de archivo que se va a servir , en este caso application/xhtml+xml según recomienda la W3C.</p>
<p>Si hacemos esto tenemos varios problemas:</p>
<ol>
<li>Debemos ser muy disciplinados creando el marcado y mas aún si el site es dinámico, a la hora de interpretarse el documento como xml, un simple elemento mal cerrado hará que nuestro site no se pueda ver o que se vea el tipico error de XML mal formado.</li>
<li>No todos los dispositivos interpretan el mime-type application/xhtml+xml, con lo que el dispositivo no entenderá el tipo de archivo que se le esta mandando y no lo interpretará</li>
</ol>
<p>Por curiosidad me meto en la W3C y la verdad me resulto algo confuso, en algunos casos te dicen que DEBES poner un mime type y en otros casos que PUEDES. Con lo que decido seguir buscando y me encuentro con esta <a href="http://keystonewebsites.com/articles/mime_type.php" target="_blank">tabla de compatibilidades doctype/mime-type</a>.</p>
<p>Soluciones que veo:</p>
<ol>
<li>Servir todo como text/html  , que según la W3C no es lo mas recomendable pero funciona.</li>
<li>Detectar cuando se va a servir la pagina si el el dispositivo desde el que se solicita soporta archivos del tipo application/xhtml+xml y sino es asi cambiar el doctype por XHTML 1.0 Strict y el mime-type por text/html. Cuidado con esto porque puede causar problemas.  Aqui puedes ver las <a title="diferencias entre XHTML 1.0 Strict y Transitional" href="http://www.zvon.org/xxl/xhtmlReference/Output/comparison.html" target="_blank">diferencias entre XHTML 1.0 Strict y Transitional</a>.</li>
</ol>
<p>Gracias a @richmanblues por la correción.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notwithoutmycode.com/2009/07/23/hello-world-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

