<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: jQuery Include</title>
	<atom:link href="http://www.gnucitizen.org/blog/jquery-include/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gnucitizen.org/blog/jquery-include/</link>
	<description>Information Security Think Tank</description>
	<lastBuildDate>Thu, 11 Mar 2010 22:49:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-128165</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Tue, 23 Feb 2010 09:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-128165</guid>
		<description>igor, this script is pretty much outdated</description>
		<content:encoded><![CDATA[<p>igor, this script is pretty much outdated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cylab</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-128155</link>
		<dc:creator>cylab</dc:creator>
		<pubDate>Sun, 21 Feb 2010 00:11:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-128155</guid>
		<description>Sorry for the necro, but I made nearly the same thing today with the slight diffenrence of just using jQuery.ajax() instead of addind script tags, so this solution should work with multilevel includes as well:

&lt;pre&gt;&lt;code&gt;      jQuery.extend({
          _includeCache: new Array(),

          // a javascript include function
          // CAUTION: this relies on the fact, that jQuery detects when the page is finished loading,
          //                 so don&#039;t use this inside jQuery(document).ready( function($){} )
          // TODO: check, if this is called within jQuery(document).ready() and throw some error
          include: function(){
              var current= jQuery._includeCache.length;
              // just copy the filenames to the include cache for later usage
              for( var i = 0; i &lt; arguments.length; i++ ) {
                  // TODO: check for file duplicates!
                  // TODO: resolve relative filenames in multilevel includes
                  jQuery._includeCache[current++]={filename:arguments[i], ready:false, loading:false}
              }
          },

          // we need to overwrite the jQuery.ready function that gets called periodically
          // to reliably load all our included javascripts sequencially
          _super_ready: jQuery.ready,
          ready: function(){
              for(var i=0; i &lt; jQuery._includeCache.length;i++)
              {
                  var include = jQuery._includeCache[i];
                  // if we encounter an unloaded javascript, start the ajax call
                  if(!include.ready &amp;&amp; !include.loading)
                  {
                      jQuery.ajax({
                          url:include.filename, dataType:&#039;script&#039;,
                          async:false, cache: true,
                          success:function(){include.ready=true},
                          // TODO: how about some error-messages??
                          error:function(){include.ready=true; include.loading=false}
                      });
                      include.loading=true;
                  }
                  // if we encounter a loading javascript, just return from this function
                  // on the next ready() call we will check this again
                  else if(!include.ready &amp;&amp; include.loading) return
              }
              // we should have included everything when we have come to this line,
              // so now delegate to the original jQuery ready check
              jQuery._super_ready(arguments);
          }
      });&lt;/code&gt;&lt;/pre&gt;

It still needs some work (see the TODOs), but may be usefull nonetheless</description>
		<content:encoded><![CDATA[<p>Sorry for the necro, but I made nearly the same thing today with the slight diffenrence of just using jQuery.ajax() instead of addind script tags, so this solution should work with multilevel includes as well:</p>
<pre><code>      jQuery.extend({
          _includeCache: new Array(),

          // a javascript include function
          // CAUTION: this relies on the fact, that jQuery detects when the page is finished loading,
          //                 so don't use this inside jQuery(document).ready( function($){} )
          // TODO: check, if this is called within jQuery(document).ready() and throw some error
          include: function(){
              var current= jQuery._includeCache.length;
              // just copy the filenames to the include cache for later usage
              for( var i = 0; i &lt; arguments.length; i++ ) {
                  // TODO: check for file duplicates!
                  // TODO: resolve relative filenames in multilevel includes
                  jQuery._includeCache[current++]={filename:arguments[i], ready:false, loading:false}
              }
          },

          // we need to overwrite the jQuery.ready function that gets called periodically
          // to reliably load all our included javascripts sequencially
          _super_ready: jQuery.ready,
          ready: function(){
              for(var i=0; i &lt; jQuery._includeCache.length;i++)
              {
                  var include = jQuery._includeCache[i];
                  // if we encounter an unloaded javascript, start the ajax call
                  if(!include.ready &amp;&amp; !include.loading)
                  {
                      jQuery.ajax({
                          url:include.filename, dataType:&#039;script&#039;,
                          async:false, cache: true,
                          success:function(){include.ready=true},
                          // TODO: how about some error-messages??
                          error:function(){include.ready=true; include.loading=false}
                      });
                      include.loading=true;
                  }
                  // if we encounter a loading javascript, just return from this function
                  // on the next ready() call we will check this again
                  else if(!include.ready &amp;&amp; include.loading) return
              }
              // we should have included everything when we have come to this line,
              // so now delegate to the original jQuery ready check
              jQuery._super_ready(arguments);
          }
      });</code></pre>
<p>It still needs some work (see the TODOs), but may be usefull nonetheless</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: igor</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-128103</link>
		<dc:creator>igor</dc:creator>
		<pubDate>Fri, 15 Jan 2010 10:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-128103</guid>
		<description>what about using the getScript() method ?

http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback</description>
		<content:encoded><![CDATA[<p>what about using the getScript() method ?</p>
<p><a href="http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback" rel="nofollow">http://docs.jquery.com/Ajax/jQ.....rlcallback</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-127985</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Mon, 09 Nov 2009 22:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-127985</guid>
		<description>GenericProdigy, this code has long been outdated. I doubt I will ever get back to this. :)</description>
		<content:encoded><![CDATA[<p>GenericProdigy, this code has long been outdated. I doubt I will ever get back to this. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GenericProdigy</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-127884</link>
		<dc:creator>GenericProdigy</dc:creator>
		<pubDate>Fri, 02 Oct 2009 14:46:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-127884</guid>
		<description>CSS already provides a capability to include using the @import directive. I&#039;m not sure if I see a point in adding functionality for that when web standards already provide a method.</description>
		<content:encoded><![CDATA[<p>CSS already provides a capability to include using the @import directive. I&#8217;m not sure if I see a point in adding functionality for that when web standards already provide a method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-127861</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Sat, 19 Sep 2009 23:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-127861</guid>
		<description>share the joy :)</description>
		<content:encoded><![CDATA[<p>share the joy :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moises Marquez</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-127828</link>
		<dc:creator>Moises Marquez</dc:creator>
		<pubDate>Tue, 08 Sep 2009 12:12:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-127828</guid>
		<description>I&#039;ve added a method includeCSS to add CSS (obviously) too. It&#039;s trivial but if anyone wants it I can send you.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve added a method includeCSS to add CSS (obviously) too. It&#8217;s trivial but if anyone wants it I can send you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-127824</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Mon, 07 Sep 2009 17:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-127824</guid>
		<description>10x Richard. I am aware of this. Unfortunately, I cannot find time to update it and I think that there are already much better solutions than mine.</description>
		<content:encoded><![CDATA[<p>10x Richard. I am aware of this. Unfortunately, I cannot find time to update it and I think that there are already much better solutions than mine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-127806</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Fri, 28 Aug 2009 18:29:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-127806</guid>
		<description>There is a bug with this script in Google Chrome.  The ready state changes and the document.ready function fires before the resources of the script are available to use.  So if you include a script that defines myObject.myVar and then try to make a call to myObject.myVar in $(document).ready it will return a &quot;cannot get property myVar of undefined&quot; error.</description>
		<content:encoded><![CDATA[<p>There is a bug with this script in Google Chrome.  The ready state changes and the document.ready function fires before the resources of the script are available to use.  So if you include a script that defines myObject.myVar and then try to make a call to myObject.myVar in $(document).ready it will return a &#8220;cannot get property myVar of undefined&#8221; error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ZK@Web Marketing Blog</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-127508</link>
		<dc:creator>ZK@Web Marketing Blog</dc:creator>
		<pubDate>Sat, 20 Jun 2009 17:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-127508</guid>
		<description>Agree, JQuery is an amazing tool. Once I needed to write a huge web project with AJAX technologies while I knew almost nothing about AJAX then (i.e. I&#039;ve never made AJAX sites). I found JQuery and it was a great help! Like you write Li, its wrapper-based syntax, principles and documentation were so simple to learn that I write a raw prototype for main site functions literally in a single day. Definitely recommended tool!</description>
		<content:encoded><![CDATA[<p>Agree, JQuery is an amazing tool. Once I needed to write a huge web project with AJAX technologies while I knew almost nothing about AJAX then (i.e. I&#8217;ve never made AJAX sites). I found JQuery and it was a great help! Like you write Li, its wrapper-based syntax, principles and documentation were so simple to learn that I write a raw prototype for main site functions literally in a single day. Definitely recommended tool!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: $.include() - script inclusion jQuery plugin &#171; Tobiasz Cudnik</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-125415</link>
		<dc:creator>$.include() - script inclusion jQuery plugin &#171; Tobiasz Cudnik</dc:creator>
		<pubDate>Tue, 20 Jan 2009 09:19:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-125415</guid>
		<description>[...] similar plugin to that one written by Petko D. Petkov, but with couple of enchantments [...]</description>
		<content:encoded><![CDATA[<p>[...] similar plugin to that one written by Petko D. Petkov, but with couple of enchantments [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: balex</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-123950</link>
		<dc:creator>balex</dc:creator>
		<pubDate>Tue, 07 Oct 2008 13:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-123950</guid>
		<description>It is realy hard to debug when one application use more and more jquery components. Please insert this line (42) for another programmers:

&lt;pre&gt;&lt;code&gt;if (this.readyState == &#039;loaded&#039; &#124;&#124; this.readyState == &#039;complete&#039;)&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>It is realy hard to debug when one application use more and more jquery components. Please insert this line (42) for another programmers:</p>
<pre><code>if (this.readyState == 'loaded' || this.readyState == 'complete')</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: saurabh</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-123220</link>
		<dc:creator>saurabh</dc:creator>
		<pubDate>Thu, 07 Aug 2008 15:12:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-123220</guid>
		<description>Big problem in printing the polylines in firefox.</description>
		<content:encoded><![CDATA[<p>Big problem in printing the polylines in firefox.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: selim</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-123051</link>
		<dc:creator>selim</dc:creator>
		<pubDate>Tue, 22 Jul 2008 13:02:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-123051</guid>
		<description>If you want that run in Internet Explorer, the property readyState is loaded and not complete.</description>
		<content:encoded><![CDATA[<p>If you want that run in Internet Explorer, the property readyState is loaded and not complete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wiz</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-112476</link>
		<dc:creator>wiz</dc:creator>
		<pubDate>Sun, 10 Feb 2008 06:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-112476</guid>
		<description>&lt;code&gt;var test = 10;&lt;/code&gt; in a file test.js &lt;code&gt;$include(&quot;test.js&quot;);&lt;/code&gt; in another file &lt;code&gt;alert(test)&lt;/code&gt; didn&#039;t work on IE6</description>
		<content:encoded><![CDATA[<p><code>var test = 10;</code> in a file test.js <code>$include("test.js");</code> in another file <code>alert(test)</code> didn&#8217;t work on IE6</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Why crawling doesn&#8217;t matter &#124; tssci security</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-80298</link>
		<dc:creator>Why crawling doesn&#8217;t matter &#124; tssci security</dc:creator>
		<pubDate>Sun, 02 Dec 2007 20:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-80298</guid>
		<description>[...] and laughable. Apparently, John Resig had not yet checked out pdp&#8217;s jQuery extensions such as jQuery Include and jQuery JSON. John and pdp may even share a similar vision of the future, such as The Next [...]</description>
		<content:encoded><![CDATA[<p>[...] and laughable. Apparently, John Resig had not yet checked out pdp&#8217;s jQuery extensions such as jQuery Include and jQuery JSON. John and pdp may even share a similar vision of the future, such as The Next [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobiasz Cudnik</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-38351</link>
		<dc:creator>Tobiasz Cudnik</dc:creator>
		<pubDate>Wed, 01 Aug 2007 21:13:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-38351</guid>
		<description>It doesnt work because that it dont really hijak ondomready event, which is attached via reference, not name.

I wrote similar plugin with working ondomready and dependency feauture:
http://meta20.net/.include_script_inclusion_jQuery_plugin

Tested with jquery.forms. Hope you find it usefull.</description>
		<content:encoded><![CDATA[<p>It doesnt work because that it dont really hijak ondomready event, which is attached via reference, not name.</p>
<p>I wrote similar plugin with working ondomready and dependency feauture:<br />
<a href="http://meta20.net/.include_script_inclusion_jQuery_plugin" rel="nofollow">http://meta20.net/.include_scr.....ery_plugin</a></p>
<p>Tested with jquery.forms. Hope you find it usefull.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pdp</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-37683</link>
		<dc:creator>pdp</dc:creator>
		<pubDate>Sun, 29 Jul 2007 12:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-37683</guid>
		<description>rezn, that would be very useful, at least I don&#039;t have to support this plugin myself :)</description>
		<content:encoded><![CDATA[<p>rezn, that would be very useful, at least I don&#8217;t have to support this plugin myself :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rezn</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-37682</link>
		<dc:creator>rezn</dc:creator>
		<pubDate>Sun, 29 Jul 2007 12:24:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-37682</guid>
		<description>any progress with this?  it&#039;d be very useful.  it does look like its in the 1.2 roadmap at least, but no word on timing: http://docs.jquery.com/JQuery_1.2_Roadmap#.ready.28.29_waits_for_.getScript.28.29</description>
		<content:encoded><![CDATA[<p>any progress with this?  it&#8217;d be very useful.  it does look like its in the 1.2 roadmap at least, but no word on timing: <a href="http://docs.jquery.com/JQuery_1.2_Roadmap#.ready.28.29_waits_for_.getScript.28.29" rel="nofollow">http://docs.jquery.com/JQuery_.....ript.28.29</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ludoo</title>
		<link>http://www.gnucitizen.org/blog/jquery-include/comment-page-1/#comment-35733</link>
		<dc:creator>ludoo</dc:creator>
		<pubDate>Tue, 17 Jul 2007 11:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.gnucitizen.org/blog/jquery-include#comment-35733</guid>
		<description>Can you extend your plugin to integrate css stylesheets loading ?

Thanks
LudoO</description>
		<content:encoded><![CDATA[<p>Can you extend your plugin to integrate css stylesheets loading ?</p>
<p>Thanks<br />
LudoO</p>
]]></content:encoded>
	</item>
</channel>
</rss>
