<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: JS includes - the saga continues&#8230;</title>
	<link>http://www.phpied.com/javascript-include-ready-onload/</link>
	<description>Stoyan's blog about (x)html, ajax, bookmarklets, browsers, css, firebug, javascript, json, mdb2, mysql, pear, performance, php, phpbb, tools, yslow, yui, writing, music,... life and everything.</description>
	<pubDate>Sun, 11 May 2008 23:51:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.1</generator>

	<item>
		<title>by: dottwatson</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-64240</link>
		<pubDate>Tue, 22 Apr 2008 23:41:16 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-64240</guid>
					<description>Hi!!
I've found a problem whit IE6 and its cache. 
If I make the call on a  page opened for first time, the readyState result == 'loaded', and the second time on the same page NOT reloaded, the readyState is == 'complete'.

i've resolved whit

  jsel.onreadystatechange = function () 
    {
    if (jsel.readyState == 'loaded' &amp;#124;&amp;#124; jsel.readyState == 'complete') 
      {
      alert('JS onreadystate fired');
      }
    }

please note that in IE6, the second call to the same object is not really executed!

My experiment was tested on a php page whit  a for cicle from 1 to 10000 and the execution time is aboute more than 3 sec.
first time i've called  this script (whit empty iE6 cache) , the execution time was exactly 3 sec... right! the popup have respected the execution script :)

but second time it was immediate... cache control?</description>
		<content:encoded><![CDATA[<p>Hi!!<br />
I've found a problem whit IE6 and its cache.<br />
If I make the call on a  page opened for first time, the readyState result == 'loaded', and the second time on the same page NOT reloaded, the readyState is == 'complete'.</p>
<p>i've resolved whit</p>
<p>  jsel.onreadystatechange = function ()<br />
    {<br />
    if (jsel.readyState == 'loaded' || jsel.readyState == 'complete')<br />
      {<br />
      alert('JS onreadystate fired');<br />
      }<br />
    }</p>
<p>please note that in IE6, the second call to the same object is not really executed!</p>
<p>My experiment was tested on a php page whit  a for cicle from 1 to 10000 and the execution time is aboute more than 3 sec.<br />
first time i've called  this script (whit empty iE6 cache) , the execution time was exactly 3 sec&#8230; right! the popup have respected the execution script <img src='http://www.phpied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>but second time it was immediate&#8230; cache control?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Benjamin</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-64181</link>
		<pubDate>Thu, 10 Apr 2008 10:20:17 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-64181</guid>
					<description>Hello! I have the same issue as Tejal. With IE6, it seems that the script is loaded but not excuted (except if there is an &quot;alert&quot; in the script).
Once the script loaded, any call to a variable or a function defined in that script will generate a &quot;undefined object&quot; error.</description>
		<content:encoded><![CDATA[<p>Hello! I have the same issue as Tejal. With IE6, it seems that the script is loaded but not excuted (except if there is an "alert" in the script).<br />
Once the script loaded, any call to a variable or a function defined in that script will generate a "undefined object" error.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Stoyan</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-64171</link>
		<pubDate>Sun, 06 Apr 2008 04:23:44 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-64171</guid>
					<description>Thanks Philip, fixed now.</description>
		<content:encoded><![CDATA[<p>Thanks Philip, fixed now.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Philip Tellis</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-64170</link>
		<pubDate>Sun, 06 Apr 2008 02:46:15 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-64170</guid>
					<description>The link to Javascript Includes on the right hand side of your homepage is broken.</description>
		<content:encoded><![CDATA[<p>The link to Javascript Includes on the right hand side of your homepage is broken.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Tejal</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-63864</link>
		<pubDate>Mon, 03 Mar 2008 13:22:05 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-63864</guid>
					<description>this code works fine for all browser except IE 6..in my case i have different tabs...user can switch between tabs and when user do that i m loading the script dynamically...that works fine for other browser as well as IE 6...but it fails in IE 6 for below scenario...

I m loading the multiple scripts when one tab is active. now script are loading for this active tab and user switched to another tab..so on active tab changed other javascritp for this current tab are also loaded dynamically..but on readystate='loaded' &amp;#124;&amp;#124; readystate=='completed' i try to call the function of loaded script. but i m getting the undefined error and i found that thought i m getting the readystate = 'loaded' or 'complete' my javascript is not loaded..is there any issue with IE 6 loading the scritp...this happend only when my previous requested script are not loaded and i request another script...but how it is possible to complere the request which was  made later....</description>
		<content:encoded><![CDATA[<p>this code works fine for all browser except IE 6..in my case i have different tabs&#8230;user can switch between tabs and when user do that i m loading the script dynamically&#8230;that works fine for other browser as well as IE 6&#8230;but it fails in IE 6 for below scenario&#8230;</p>
<p>I m loading the multiple scripts when one tab is active. now script are loading for this active tab and user switched to another tab..so on active tab changed other javascritp for this current tab are also loaded dynamically..but on readystate='loaded' || readystate=='completed' i try to call the function of loaded script. but i m getting the undefined error and i found that thought i m getting the readystate = 'loaded' or 'complete' my javascript is not loaded..is there any issue with IE 6 loading the scritp&#8230;this happend only when my previous requested script are not loaded and i request another script&#8230;but how it is possible to complere the request which was  made later&#8230;.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Incluye tus Archivos JS y CSS Cuando los necesites &#171; Neozeratul en la Red</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-61917</link>
		<pubDate>Wed, 15 Aug 2007 17:08:08 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-61917</guid>
					<description>[...] Incluye tus Archivos JS y CSS Cuando los&amp;#160;necesites  Bueno pues no se si a alguno de ustedes les ha surgido el problema de que su sistema esta demasiado cargado al inicio de archivos javascript y css que realmente solo lo utilizan ciertos módulos, pues a mi hace unos meses me surgió ese problema e investigando me puse a trabajar en una libreria que cargara los archivos Javascript mediante el DOM simplemente llamando a un método. La libreria fue basada en este artículo de Sentido Web y en este otro de phpied. El código es el siguiente: [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Incluye tus Archivos JS y CSS Cuando los&nbsp;necesites  Bueno pues no se si a alguno de ustedes les ha surgido el problema de que su sistema esta demasiado cargado al inicio de archivos javascript y css que realmente solo lo utilizan ciertos módulos, pues a mi hace unos meses me surgió ese problema e investigando me puse a trabajar en una libreria que cargara los archivos Javascript mediante el DOM simplemente llamando a un método. La libreria fue basada en este artículo de Sentido Web y en este otro de phpied. El código es el siguiente: [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: All in a days work&#8230;</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-60659</link>
		<pubDate>Fri, 22 Jun 2007 23:58:17 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-60659</guid>
					<description>[...] Delay loading your (print) CSS and / or JavaScript So there is, after all, a cross-browser way to tell when a JavaScript is actually included and that is to attach two event listeners - onload and onreadystatechange. In IE you also have two ways to tell when a CSS is included. (tags: JavaScript CSS IE)   Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Delay loading your (print) CSS and / or JavaScript So there is, after all, a cross-browser way to tell when a JavaScript is actually included and that is to attach two event listeners - onload and onreadystatechange. In IE you also have two ways to tell when a CSS is included. (tags: JavaScript CSS IE)   Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: phpied.com &#187; Blog Archive &#187; Delay loading your print CSS</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-60375</link>
		<pubDate>Mon, 18 Jun 2007 03:42:21 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-60375</guid>
					<description>[...] Well, in order to increase rendering performance, all stylesheets not absolutely needed to initially render a page should be loaded after the page load, in the background. Once the user has a fast rendered page to interact with, you can load the additional CSS (and JavaScripts for that matter) in the background, using script and style DOM includes.  Post this entry to: &amp;#187; del.icio.us&amp;#160; &amp;#187; Digg&amp;#160; &amp;#187; Furl&amp;#160; &amp;#187; Newsvine&amp;#160; &amp;#187; reddit&amp;#160; &amp;#187; Y! [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Well, in order to increase rendering performance, all stylesheets not absolutely needed to initially render a page should be loaded after the page load, in the background. Once the user has a fast rendered page to interact with, you can load the additional CSS (and JavaScripts for that matter) in the background, using script and style DOM includes.  Post this entry to: &raquo; del.icio.us&nbsp; &raquo; Digg&nbsp; &raquo; Furl&nbsp; &raquo; Newsvine&nbsp; &raquo; reddit&nbsp; &raquo; Y! [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Thomas Urban</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-55944</link>
		<pubDate>Sun, 20 May 2007 22:20:33 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-55944</guid>
					<description>Thanks for this code on handling an included script's onload event. I tried to get a working solution for Opera9.2 and found one not mentioned before: Opera is supporting DOM2 Event Model and thus it supports addEventListener() just like Firefox (tested with FF2 here). For supporting Firefox and Opera the onload-code in example above might be adjusted like this:

if ( js.addEventListener )
    js.addEventListener( 'load', function() { your code }, false );

Could you try this with Safari as it is marked to support DOM2 Event Model as well.</description>
		<content:encoded><![CDATA[<p>Thanks for this code on handling an included script's onload event. I tried to get a working solution for Opera9.2 and found one not mentioned before: Opera is supporting DOM2 Event Model and thus it supports addEventListener() just like Firefox (tested with FF2 here). For supporting Firefox and Opera the onload-code in example above might be adjusted like this:</p>
<p>if ( js.addEventListener )<br />
    js.addEventListener( 'load', function() { your code }, false );</p>
<p>Could you try this with Safari as it is marked to support DOM2 Event Model as well.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: links for 2007-05-02 &#171; toonz</title>
		<link>http://www.phpied.com/javascript-include-ready-onload/#comment-55240</link>
		<pubDate>Wed, 02 May 2007 23:42:42 +0000</pubDate>
		<guid>http://www.phpied.com/javascript-include-ready-onload/#comment-55240</guid>
					<description>[...] phpied.com » Blog Archive » JS includes - the saga continues… (tags: JavaScript) [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] phpied.com » Blog Archive » JS includes - the saga continues… (tags: JavaScript) [&#8230;]
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
