<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.byte-force.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>"Using" for javascript</title><link>http://blogs.byte-force.com/xor/archive/2008/04/16/1758.aspx</link><description>Ajaxian writes about using.js library created by Jon Davis. It allows for loading javascript files on demand, just before you need it. For more details on this please see Ajaxian and original post by Jon . I&amp;#39;ll write about differences in his and ours</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30912.2823)</generator><item><title>Загрузчиков JS все прибывает</title><link>http://blogs.byte-force.com/xor/archive/2008/04/16/1758.aspx#2769</link><pubDate>Fri, 27 Feb 2009 17:39:02 GMT</pubDate><guid isPermaLink="false">2d7b5c81-17d2-487b-a0e9-0530898b531a:2769</guid><dc:creator>«XOR's Post»</dc:creator><description>&lt;p&gt;Довольно давно я писал про «Using» для яваскрипта . С тех пор мы успели сделать свой продвинутый загрузчик&lt;/p&gt;
&lt;img src="http://blogs.byte-force.com/aggbug.aspx?PostID=2769" width="1" height="1"&gt;</description></item><item><title>re: "Using" for javascript</title><link>http://blogs.byte-force.com/xor/archive/2008/04/16/1758.aspx#1763</link><pubDate>Thu, 17 Apr 2008 07:56:02 GMT</pubDate><guid isPermaLink="false">2d7b5c81-17d2-487b-a0e9-0530898b531a:1763</guid><dc:creator>Andrew Mayorov</dc:creator><description>&lt;p&gt;Great!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.byte-force.com/aggbug.aspx?PostID=1763" width="1" height="1"&gt;</description></item><item><title>re: "Using" for javascript</title><link>http://blogs.byte-force.com/xor/archive/2008/04/16/1758.aspx#1762</link><pubDate>Thu, 17 Apr 2008 05:30:35 GMT</pubDate><guid isPermaLink="false">2d7b5c81-17d2-487b-a0e9-0530898b531a:1762</guid><dc:creator>Jon Davis</dc:creator><description>&lt;p&gt;Implemented. I also added zero-registration late loading:&lt;/p&gt;
&lt;p&gt;using('url(&lt;a rel="nofollow" target="_new" href="http://cachefile.net/scripts/jquery/1.2.3/jquery-1.2.3.js"&gt;cachefile.net/.../jquery-1.2.3.js&lt;/a&gt;)', function() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; $(document).ready(function() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; alert(&amp;quot;document loaded&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; });&lt;/p&gt;
&lt;p&gt;});&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.byte-force.com/aggbug.aspx?PostID=1762" width="1" height="1"&gt;</description></item><item><title>re: "Using" for javascript</title><link>http://blogs.byte-force.com/xor/archive/2008/04/16/1758.aspx#1761</link><pubDate>Wed, 16 Apr 2008 21:26:15 GMT</pubDate><guid isPermaLink="false">2d7b5c81-17d2-487b-a0e9-0530898b531a:1761</guid><dc:creator>Jon Davis</dc:creator><description>&lt;p&gt;&amp;quot;But look, while we stay on one page is it really big advantage over simple: using( 'jquery', 'jquery-blockUI', function ... ?&amp;quot;&lt;/p&gt;
&lt;p&gt;So all args that preced the callback function, they being strings, are dependency names. Easy enough to add, I'll add it tonight. ;)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.byte-force.com/aggbug.aspx?PostID=1761" width="1" height="1"&gt;</description></item><item><title>re: "Using" for javascript</title><link>http://blogs.byte-force.com/xor/archive/2008/04/16/1758.aspx#1760</link><pubDate>Wed, 16 Apr 2008 10:56:01 GMT</pubDate><guid isPermaLink="false">2d7b5c81-17d2-487b-a0e9-0530898b531a:1760</guid><dc:creator>Andrew Mayorov</dc:creator><description>&lt;p&gt;Hi Jon! For me it's always harder to write about something, than code it. So our synchronization makes me think about noosphere again. :)&lt;/p&gt;
&lt;p&gt;You are right, it's impossible to do so with my approach. But look, while we stay on one page is it really big advantage over simple:&lt;/p&gt;
&lt;p&gt;using( 'jquery', 'jquery-blockUI', function ... ?&lt;/p&gt;
&lt;p&gt;I think that dependencies start to really shine if you can specify them right in the file you are &amp;quot;using&amp;quot;. But neither mine, nor your approach allows for this. At least, now.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.byte-force.com/aggbug.aspx?PostID=1760" width="1" height="1"&gt;</description></item><item><title>re: "Using" for javascript</title><link>http://blogs.byte-force.com/xor/archive/2008/04/16/1758.aspx#1759</link><pubDate>Wed, 16 Apr 2008 10:28:31 GMT</pubDate><guid isPermaLink="false">2d7b5c81-17d2-487b-a0e9-0530898b531a:1759</guid><dc:creator>Jon Davis</dc:creator><description>&lt;p&gt;&amp;quot;How should we register script dependencies in this case?&amp;quot;&lt;/p&gt;
&lt;p&gt;Ironically, just as you posted, I posted a rewrite of using.js so that it can handle dependencies, like so:&lt;/p&gt;
&lt;p&gt;using(&amp;quot;jquery&amp;quot;, &amp;quot;jquery-1.2.3.js&amp;quot;);&lt;/p&gt;
&lt;p&gt;using.register(&amp;quot;jquery-blockUI&amp;quot;, &amp;quot;/jquery-blockUI.js&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; .requires(&amp;quot;jquery&amp;quot;); &lt;/p&gt;
&lt;p&gt;// load jquery and jquery-blockUI at the same time:&lt;/p&gt;
&lt;p&gt;using (&amp;quot;jquery-blockUI&amp;quot;, function() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;$.blockUI();&lt;/p&gt;
&lt;p&gt;});&lt;/p&gt;
&lt;p&gt;At that point it's really up to the developer to maintain consistency in naming conventions and dependency declarations.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.byte-force.com/aggbug.aspx?PostID=1759" width="1" height="1"&gt;</description></item></channel></rss>