<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>InfoSauce: Category CSS-DOM-standards</title>
  <id>tag:blog.infosauce.com,2005:Typo</id>
  <generator uri="http://www.typosphere.org" version="4.0">Typo</generator>
  <link href="http://blog.infosauce.com/xml/atom/category/css-dom-standards/feed.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.infosauce.com/articles/category/css-dom-standards" rel="alternate" type="text/html"/>
  <updated>2006-10-26T21:43:31-07:00</updated>
  <entry>
    <author>
      <name>Tim</name>
    </author>
    <id>urn:uuid:3e9bd75b-7c18-438a-8296-eabbab69edf9</id>
    <published>2005-09-28T06:59:00-07:00</published>
    <updated>2006-10-26T21:43:31-07:00</updated>
    <title type="html">Multiple file upload and the abuse of buzzwords</title>
    <link href="http://blog.infosauce.com/articles/2005/09/28/multiple-file-upload-and-the-abuse-of-buzzwords" rel="alternate" type="text/html"/>
    <category term="general" scheme="http://blog.infosauce.com/articles/category/general" label="General"/>
    <category term="css-dom-standards" scheme="http://blog.infosauce.com/articles/category/css-dom-standards" label="CSS-DOM-standards"/>
    <summary type="html">&lt;p&gt;&lt;a href="http://the-stickman.com/"&gt;Stickman&lt;/a&gt; has posted a &lt;a href="http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/"&gt;cool &lt;span class="caps"&gt;DOM&lt;/span&gt;-scripted multiple form upload&lt;/a&gt; and, of course, through no fault of his, commentors are assumming it must be &lt;span class="caps"&gt;AJAX&lt;/span&gt;, since it&amp;#8217;s on the web and it&amp;#8217;s new and cool.  &lt;a href="http://www.quirksmode.org/blog/archives/2005/06/you_shouldve_be_1.html"&gt;PPK has talked about this issue before&lt;/a&gt; but it looks like calling everything &amp;#8220;AJAX&amp;#8221; really is spreading to even geek bloggers watching web development (it&amp;#8217;s only in the talkbacks, so far) who you would hope would be Marketing-ese proof.&lt;/p&gt;


	&lt;p&gt;Now, we&amp;#8217;ve got nothing against &lt;span class="caps"&gt;AJAX&lt;/span&gt;, it&amp;#8217;s a great technique that we like using, as appropriate, but this is &lt;span class="caps"&gt;DOM&lt;/span&gt;-scripting pure and simple.  &lt;span class="caps"&gt;AJAX&lt;/span&gt;-like technologies have to do with how you handle the round trip to the server without reloading the page and, in this context, would look more like &lt;a href="http://ktk.xs4all.nl/stuff/html/simultaneous-uploading-using-iframes/"&gt;this&lt;/a&gt;  (thanks to one of the other posters for the link). &lt;span class="caps"&gt;AJAX&lt;/span&gt; could be added onto Stickman&amp;#8217;s work to just refresh the part of the page handling the upload, and something similar is used by Basecamp, already, to get around the multiple file upload another way.&lt;/p&gt;


	&lt;p&gt;Personally, I think what Stickman is doing is far cooler than &lt;span class="caps"&gt;AJAX&lt;/span&gt;, as he&amp;#8217;s getting around a more fundamental browser limitation.  What you can do with the &lt;span class="caps"&gt;HTML&lt;/span&gt; form upload control is severely restricted in browsers, largely for security reasons.  For too long  it&amp;#8217;s been a basic assumption in web development that you might as well not try to do anything fancy with the form upload widget, since it&amp;#8217;s fairly locked down.  In fact, it&amp;#8217;s still possible for the browser implementors to decide that hiding the widget is a potential security risk, and then this technique goes out the window.  Until then, though, it&amp;#8217;s useful to have in the toolbox, and even if it gets locked-out by some browsers in the future, it still gets us thinking about how to work around those limitations again.&lt;/p&gt;


	&lt;p&gt;Generally, I think the Basecamp approach of actually doing it through &lt;span class="caps"&gt;AJAX &lt;/span&gt;(similar to the &amp;#8220;this&amp;#8221; link above) would often be a better choice, as it allows more granular feedback and control.  For instance they confirm each upload and then allow you to re-label it prior to sending a message off.  This also avoids having to wait for one massive upload at the end, which might kill your whole message, instead of just the individual upload. Regardless, Stickman&amp;#8217;s approach is still cool.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;&lt;a href="http://the-stickman.com/"&gt;Stickman&lt;/a&gt; has posted a &lt;a href="http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/"&gt;cool &lt;span class="caps"&gt;DOM&lt;/span&gt;-scripted multiple form upload&lt;/a&gt; and, of course, through no fault of his, commentors are assumming it must be &lt;span class="caps"&gt;AJAX&lt;/span&gt;, since it&amp;#8217;s on the web and it&amp;#8217;s new and cool.  &lt;a href="http://www.quirksmode.org/blog/archives/2005/06/you_shouldve_be_1.html"&gt;PPK has talked about this issue before&lt;/a&gt; but it looks like calling everything &amp;#8220;AJAX&amp;#8221; really is spreading to even geek bloggers watching web development (it&amp;#8217;s only in the talkbacks, so far) who you would hope would be Marketing-ese proof.&lt;/p&gt;


	&lt;p&gt;Now, we&amp;#8217;ve got nothing against &lt;span class="caps"&gt;AJAX&lt;/span&gt;, it&amp;#8217;s a great technique that we like using, as appropriate, but this is &lt;span class="caps"&gt;DOM&lt;/span&gt;-scripting pure and simple.  &lt;span class="caps"&gt;AJAX&lt;/span&gt;-like technologies have to do with how you handle the round trip to the server without reloading the page and, in this context, would look more like &lt;a href="http://ktk.xs4all.nl/stuff/html/simultaneous-uploading-using-iframes/"&gt;this&lt;/a&gt;  (thanks to one of the other posters for the link). &lt;span class="caps"&gt;AJAX&lt;/span&gt; could be added onto Stickman&amp;#8217;s work to just refresh the part of the page handling the upload, and something similar is used by Basecamp, already, to get around the multiple file upload another way.&lt;/p&gt;


	&lt;p&gt;Personally, I think what Stickman is doing is far cooler than &lt;span class="caps"&gt;AJAX&lt;/span&gt;, as he&amp;#8217;s getting around a more fundamental browser limitation.  What you can do with the &lt;span class="caps"&gt;HTML&lt;/span&gt; form upload control is severely restricted in browsers, largely for security reasons.  For too long  it&amp;#8217;s been a basic assumption in web development that you might as well not try to do anything fancy with the form upload widget, since it&amp;#8217;s fairly locked down.  In fact, it&amp;#8217;s still possible for the browser implementors to decide that hiding the widget is a potential security risk, and then this technique goes out the window.  Until then, though, it&amp;#8217;s useful to have in the toolbox, and even if it gets locked-out by some browsers in the future, it still gets us thinking about how to work around those limitations again.&lt;/p&gt;


	&lt;p&gt;Generally, I think the Basecamp approach of actually doing it through &lt;span class="caps"&gt;AJAX &lt;/span&gt;(similar to the &amp;#8220;this&amp;#8221; link above) would often be a better choice, as it allows more granular feedback and control.  For instance they confirm each upload and then allow you to re-label it prior to sending a message off.  This also avoids having to wait for one massive upload at the end, which might kill your whole message, instead of just the individual upload. Regardless, Stickman&amp;#8217;s approach is still cool.&lt;/p&gt;

</content>
  </entry>
  <entry>
    <author>
      <name>Tim</name>
    </author>
    <id>urn:uuid:dacf94ae-5012-42e9-a8aa-00f5fa2c1fcb</id>
    <published>2005-09-24T16:08:00-07:00</published>
    <updated>2006-10-26T21:43:54-07:00</updated>
    <title type="html">Cross-browser onDOMContentLoaded</title>
    <link href="http://blog.infosauce.com/articles/2005/09/24/cross-browser-ondomcontentloaded" rel="alternate" type="text/html"/>
    <category term="css-dom-standards" scheme="http://blog.infosauce.com/articles/category/css-dom-standards" label="CSS-DOM-standards"/>
    <summary type="html">&lt;p&gt;&lt;a href="http://dean.edwards.name/weblog/2005/09/busted/"&gt;An elegant solution to the window.onload problem in Mozilla and IE.&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Client-side developers have long been frustrated by the shortcomings of window.onload, namely that it takes too long before firing if you want to attach scripts to rework the &lt;span class="caps"&gt;&lt;span class="caps"&gt;DOM&lt;/span&gt;&lt;/span&gt;, yet you have to wait before the &lt;span class="caps"&gt;&lt;span class="caps"&gt;DOM&lt;/span&gt;&lt;/span&gt; is parsed before manipulating it.&lt;/p&gt;

    &lt;p&gt;The &lt;a href="http://greasemonkey.mozdev.org/"&gt;Greasemonkey&lt;/a&gt; chaps solved the problem in Mozilla Firefox by uncovering the proprietary &lt;span class="caps"&gt;&lt;span class="caps"&gt;DOM&lt;/span&gt;&lt;/span&gt;ContentLoaded event.  Now not solving the problem in all browsers would be acceptable, since the other browsers could fall-back to the late firing window.onload, but it’s unrealistic to consider a solution for general web use that doesn’t at least take care of 90% of the market (Windows IE).&lt;/p&gt;

    &lt;p&gt;Ever since the &lt;a href="http://www.quirksmode.org/"&gt;&lt;span class="caps"&gt;PPK&lt;/span&gt;&lt;/a&gt; mentioned something in his blog about a way to solve it in IE and Mozilla(maybe Safari) in the &lt;a href="http://www.quirksmode.org/blog/archives/2005/06/you_shouldve_be_1.html"&gt;@media event entries&lt;/a&gt; a number of us have been very excited.  We’ve been &lt;a href="http://dean.edwards.name/weblog/2005/02/order-of-events/#comment2370"&gt;contemplating the best way to use this knowledge&lt;/a&gt;  involving complicated schemes requiring behaviors in &lt;span class="caps"&gt;IE &lt;/span&gt;(.htc files) and waiting for the mysterious “more details to come”&lt;/p&gt;

    &lt;p&gt;Well, the details have arrived, and it seems to make most of the scripts to handle an early firing domloaded event moot. Dean Edwards has delivered an &lt;a href="http://dean.edwards.name/weblog/2005/09/busted/"&gt;elegant solution to the window.onload problem in Mozilla and IE.&lt;/a&gt; If Safari/kthml, Opera, or any of the other browsers not covered by this are an important enough factor at your site, you might have to still think about an alternative like &lt;a href="http://www.brothercake.com/site/resources/scripts/domready/"&gt;brothercake’s domFunction.&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;We’re going to just stick with Dean Edwards solution for now and call it good, though.  Especially since, according to work done on the sIFR image replacement technique, &lt;a href="http://web-graphics.com/mtarchive/001635.php"&gt;Safari won’t layout the page properly until the images are loaded&lt;/a&gt; (read the 3rd comment).  This means having Safari wait for the window.onload is actually a feature.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;&lt;a href="http://dean.edwards.name/weblog/2005/09/busted/"&gt;An elegant solution to the window.onload problem in Mozilla and IE.&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Client-side developers have long been frustrated by the shortcomings of window.onload, namely that it takes too long before firing if you want to attach scripts to rework the &lt;span class="caps"&gt;&lt;span class="caps"&gt;DOM&lt;/span&gt;&lt;/span&gt;, yet you have to wait before the &lt;span class="caps"&gt;&lt;span class="caps"&gt;DOM&lt;/span&gt;&lt;/span&gt; is parsed before manipulating it.&lt;/p&gt;

    &lt;p&gt;The &lt;a href="http://greasemonkey.mozdev.org/"&gt;Greasemonkey&lt;/a&gt; chaps solved the problem in Mozilla Firefox by uncovering the proprietary &lt;span class="caps"&gt;&lt;span class="caps"&gt;DOM&lt;/span&gt;&lt;/span&gt;ContentLoaded event.  Now not solving the problem in all browsers would be acceptable, since the other browsers could fall-back to the late firing window.onload, but it’s unrealistic to consider a solution for general web use that doesn’t at least take care of 90% of the market (Windows IE).&lt;/p&gt;

    &lt;p&gt;Ever since the &lt;a href="http://www.quirksmode.org/"&gt;&lt;span class="caps"&gt;PPK&lt;/span&gt;&lt;/a&gt; mentioned something in his blog about a way to solve it in IE and Mozilla(maybe Safari) in the &lt;a href="http://www.quirksmode.org/blog/archives/2005/06/you_shouldve_be_1.html"&gt;@media event entries&lt;/a&gt; a number of us have been very excited.  We’ve been &lt;a href="http://dean.edwards.name/weblog/2005/02/order-of-events/#comment2370"&gt;contemplating the best way to use this knowledge&lt;/a&gt;  involving complicated schemes requiring behaviors in &lt;span class="caps"&gt;IE &lt;/span&gt;(.htc files) and waiting for the mysterious “more details to come”&lt;/p&gt;

    &lt;p&gt;Well, the details have arrived, and it seems to make most of the scripts to handle an early firing domloaded event moot. Dean Edwards has delivered an &lt;a href="http://dean.edwards.name/weblog/2005/09/busted/"&gt;elegant solution to the window.onload problem in Mozilla and IE.&lt;/a&gt; If Safari/kthml, Opera, or any of the other browsers not covered by this are an important enough factor at your site, you might have to still think about an alternative like &lt;a href="http://www.brothercake.com/site/resources/scripts/domready/"&gt;brothercake’s domFunction.&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;We’re going to just stick with Dean Edwards solution for now and call it good, though.  Especially since, according to work done on the sIFR image replacement technique, &lt;a href="http://web-graphics.com/mtarchive/001635.php"&gt;Safari won’t layout the page properly until the images are loaded&lt;/a&gt; (read the 3rd comment).  This means having Safari wait for the window.onload is actually a feature.&lt;/p&gt;
</content>
  </entry>
</feed>
