<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Introducing $(document).ready()</title>
	<link>http://www.learningjquery.com/2006/09/introducing-document-ready</link>
	<description>Getting to know the library of choice for unobtrusive JavaScript</description>
	<pubDate>Thu, 28 Aug 2008 11:33:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Sid</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-54001</link>
		<dc:creator>Sid</dc:creator>
		<pubDate>Tue, 26 Aug 2008 11:35:02 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-54001</guid>
		<description>What's the syntax to have jquery run a function BEFORE the DOM is loaded. Basically, i want to do the following BEFORE the DOM is loaded. 

1) Check a cookie
2) Based on the cookie value i want to add a particular stylesheet
3) Append the stylesheet TAG in the HEAD and then have the DOM load with the appropriate Stylesheet loaded. 

Creating the cookie and having the cookie load the appropriate stylesheet is not a problem, but how do I dynamically add a stylsheet to the html using JQuery ? The only way I can think of is to use some JQuery function that runs before the DOM is loaded, and i can't find what this mystery function is...

perhaps you jQuery Guru's can help...

thanks in advance, 

Sid</description>
		<content:encoded><![CDATA[<p>What&#8217;s the syntax to have jquery run a function BEFORE the DOM is loaded. Basically, i want to do the following BEFORE the DOM is loaded. </p>
<p>1) Check a cookie<br />
2) Based on the cookie value i want to add a particular stylesheet<br />
3) Append the stylesheet TAG in the HEAD and then have the DOM load with the appropriate Stylesheet loaded. </p>
<p>Creating the cookie and having the cookie load the appropriate stylesheet is not a problem, but how do I dynamically add a stylsheet to the html using JQuery ? The only way I can think of is to use some JQuery function that runs before the DOM is loaded, and i can&#8217;t find what this mystery function is&#8230;</p>
<p>perhaps you jQuery Guru&#8217;s can help&#8230;</p>
<p>thanks in advance, </p>
<p>Sid</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sravanthi</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-52090</link>
		<dc:creator>sravanthi</dc:creator>
		<pubDate>Sat, 26 Jul 2008 09:11:09 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-52090</guid>
		<description>how to adda row to the existing grid.</description>
		<content:encoded><![CDATA[<p>how to adda row to the existing grid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yavuz Bogazci</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-50353</link>
		<dc:creator>Yavuz Bogazci</dc:creator>
		<pubDate>Wed, 02 Jul 2008 07:02:26 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-50353</guid>
		<description>Hi,

i am new to jquery and wanted to build a simple website to test it. in the &#60;head&#62; part of my page i have this javascript
&lt;pre&gt;&lt;code&gt;
$(document).ready(function() {
		$.ajax({
  		  type: "POST",
	      url: "ajax.tasklist.php",
	      dataType: "html",
	      beforeSend: function(){$("div.loading").show()},
	      complete: function(){$("div.loading").hide()},
		  success: function(msg){
		  	$('div#tasklist').html(msg);}
		});
	});

	function save() {
		alter ("hallo");		
	}
&lt;/code&gt;&lt;/pre&gt;
in the html part the following elements
&lt;pre&gt;&lt;code&gt;

  
    &#160;
    urlfield
    &lt;a href="" rel="nofollow"&gt;save&lt;/a&gt;
    &lt;a href="" rel="nofollow"&gt;Link&lt;/a&gt;
  

&lt;/code&gt;&lt;/pre&gt;
each time when i click on "save" the page is completely reloaded. I don't know why. has someone the same problem?

thanks
Yavuz</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>i am new to jquery and wanted to build a simple website to test it. in the &lt;head&gt; part of my page i have this javascript</p>
<pre><code>
$(document).ready(function() {
		$.ajax({
  		  type: "POST",
	      url: "ajax.tasklist.php",
	      dataType: "html",
	      beforeSend: function(){$("div.loading").show()},
	      complete: function(){$("div.loading").hide()},
		  success: function(msg){
		  	$('div#tasklist').html(msg);}
		});
	});

	function save() {
		alter ("hallo");
	}
</code></pre>
<p>in the html part the following elements</p>
<pre><code>

    &nbsp;
    urlfield
    <a href="" rel="nofollow">save</a>
    <a href="" rel="nofollow">Link</a>

</code></pre>
<p>each time when i click on &#8220;save&#8221; the page is completely reloaded. I don&#8217;t know why. has someone the same problem?</p>
<p>thanks<br />
Yavuz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shan</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-49865</link>
		<dc:creator>shan</dc:creator>
		<pubDate>Wed, 25 Jun 2008 05:23:25 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-49865</guid>
		<description>Is am I able to pass argument to the function. Because i want to use id of the perticular control.</description>
		<content:encoded><![CDATA[<p>Is am I able to pass argument to the function. Because i want to use id of the perticular control.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-48050</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Fri, 23 May 2008 18:41:56 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-48050</guid>
		<description>Hi there,

The "$" is just an alias for the jQuery() method. So, the above code would work just as well written like this:
&lt;pre&gt;&lt;code&gt;jQuery(document).ready(function() {
	// put all your jQuery goodness in here.
});&lt;/code&gt;&lt;/pre&gt;
A lot of JavaScript libraries use the dollar symbol, but only because it's a single character. Nothing special about it.</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>The &#8220;$&#8221; is just an alias for the jQuery() method. So, the above code would work just as well written like this:</p>
<pre><code>jQuery(document).ready(function() {
	// put all your jQuery goodness in here.
});</code></pre>
<p>A lot of JavaScript libraries use the dollar symbol, but only because it&#8217;s a single character. Nothing special about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cybercow222</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-48043</link>
		<dc:creator>cybercow222</dc:creator>
		<pubDate>Fri, 23 May 2008 16:06:42 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-48043</guid>
		<description>can i ask one nob question, why the dollar sign prefix "$" before the constructor function names, it seems like php var declaration but`s not ... cheers ...</description>
		<content:encoded><![CDATA[<p>can i ask one nob question, why the dollar sign prefix &#8220;$&#8221; before the constructor function names, it seems like php var declaration but`s not &#8230; cheers &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eirik S</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-48026</link>
		<dc:creator>Eirik S</dc:creator>
		<pubDate>Fri, 23 May 2008 10:29:09 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-48026</guid>
		<description>sweet, thanks Karl that's &lt;em&gt;just&lt;/em&gt; what I need.
awesome!</description>
		<content:encoded><![CDATA[<p>sweet, thanks Karl that&#8217;s <em>just</em> what I need.<br />
awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-47969</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Thu, 22 May 2008 14:58:03 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-47969</guid>
		<description>Hi Eirik,

In the jquery.com documentation site, there is an &lt;a href="http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F" rel="nofollow"&gt;FAQ page&lt;/a&gt; that answers your question and provides links to a few plugins to help with your situation. Also, I recently wrote two tutorials on the topic: &lt;a href="http://www.learningjquery.com/2008/03/working-with-events-part-1" rel="nofollow"&gt;Working with Events, part 1&lt;/a&gt; and &lt;a href="http://www.learningjquery.com/2008/05/working-with-events-part-2" rel="nofollow"&gt;Working with Events, part 2&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Hi Eirik,</p>
<p>In the jquery.com documentation site, there is an <a href="http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F" rel="nofollow">FAQ page</a> that answers your question and provides links to a few plugins to help with your situation. Also, I recently wrote two tutorials on the topic: <a href="http://www.learningjquery.com/2008/03/working-with-events-part-1" rel="nofollow">Working with Events, part 1</a> and <a href="http://www.learningjquery.com/2008/05/working-with-events-part-2" rel="nofollow">Working with Events, part 2</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eirik S</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-47967</link>
		<dc:creator>Eirik S</dc:creator>
		<pubDate>Thu, 22 May 2008 14:48:43 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-47967</guid>
		<description>what about functions that needs to be available also after page load, and after elements in the page is "tampered with"?

I use jquery to send data (text) from one file to another. The second file stores the text to in database and the first file includes the second file, which now contains the fresh piece of text. The second file is included with load() 

$("#whereAllTheTextIsListedOut").load("secondFile.php .givNewStuffThisClass");

But this content that isn't loaded "on window.onload" does not behave like the content that comes by a full page reload. All the functions I have to do stuff to this content (delete, edit,..) does not work until I reload the page.

Is there any alternatives to this window.onload (or in jquery $(document).ready())?</description>
		<content:encoded><![CDATA[<p>what about functions that needs to be available also after page load, and after elements in the page is &#8220;tampered with&#8221;?</p>
<p>I use jquery to send data (text) from one file to another. The second file stores the text to in database and the first file includes the second file, which now contains the fresh piece of text. The second file is included with load() </p>
<p>$(&#8221;#whereAllTheTextIsListedOut&#8221;).load(&#8221;secondFile.php .givNewStuffThisClass&#8221;);</p>
<p>But this content that isn&#8217;t loaded &#8220;on window.onload&#8221; does not behave like the content that comes by a full page reload. All the functions I have to do stuff to this content (delete, edit,..) does not work until I reload the page.</p>
<p>Is there any alternatives to this window.onload (or in jquery $(document).ready())?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-47749</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Tue, 20 May 2008 14:40:49 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/09/introducing-document-ready#comment-47749</guid>
		<description>Hi Matt, 

There is an issue with document ready with jQuery versions 1.2.3 and 1.2.4. It now waits for CSS to load, but that might not always be desirable. You can find a discussion of it and a workaround on the &lt;a href="http://groups.google.com/group/jquery-dev/t/a757ce4dd4ed4560?hl=en" rel="nofollow"&gt;jQuery Dev google group&lt;/a&gt;. It's possible that you're seeing the problem only on less powerful machines or ones with browsers that are being slowed down for some other reason.

Yes, it is a good practice to put all your custom scripts in separate js files.</description>
		<content:encoded><![CDATA[<p>Hi Matt, </p>
<p>There is an issue with document ready with jQuery versions 1.2.3 and 1.2.4. It now waits for CSS to load, but that might not always be desirable. You can find a discussion of it and a workaround on the <a href="http://groups.google.com/group/jquery-dev/t/a757ce4dd4ed4560?hl=en" rel="nofollow">jQuery Dev google group</a>. It&#8217;s possible that you&#8217;re seeing the problem only on less powerful machines or ones with browsers that are being slowed down for some other reason.</p>
<p>Yes, it is a good practice to put all your custom scripts in separate js files.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
