<?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: What is this?</title>
	<atom:link href="http://www.learningjquery.com/2007/08/what-is-this/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2007/08/what-is-this</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Sat, 13 Mar 2010 15:20:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sinrow</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-79844</link>
		<dc:creator>sinrow</dc:creator>
		<pubDate>Sat, 13 Mar 2010 15:20:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-79844</guid>
		<description>你写的很棒阿！顶！</description>
		<content:encoded><![CDATA[<p>你写的很棒阿！顶！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanza702</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-79722</link>
		<dc:creator>sanza702</dc:creator>
		<pubDate>Thu, 18 Feb 2010 08:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-79722</guid>
		<description>Hi,

I&#039;m pulling out data from my database and displaying this on my webpage, thing is, I&#039;m fairly new at this and I&#039;d like to be able to toggle each table of data which is separated by entry in the database on its own. The layout of the page is as follows:

User:
details of that user in a table hidded in a panel:
&amp;lt div class&quot;panel&quot; &amp;gt 
&amp;lt table &amp;gt table here &amp;lt /table &amp;gt 
&amp;lt /div &amp;gt

&amp;lt p class=&quot;flip&quot; &amp;gt Click to view users&#039; details &amp;lt /p &amp;gt

Since this  happens iteratively, we end up with as many panel/tables as there are entries, but when I click on one of the panels, all get expanded obviously because they all share the same class name, below is how the javascript bit looks like, can you please assist in this regard?

$(document).ready(function(){
$(&quot;.flip&quot;).click(function(){ $(&quot;.panel&quot;).slideToggle(&quot;slow&quot;); });
});

How do I change this such that only one panel gets to be expanded?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m pulling out data from my database and displaying this on my webpage, thing is, I&#8217;m fairly new at this and I&#8217;d like to be able to toggle each table of data which is separated by entry in the database on its own. The layout of the page is as follows:</p>
<p>User:<br />
details of that user in a table hidded in a panel:<br />
&amp;lt div class&#8221;panel&#8221; &amp;gt<br />
&amp;lt table &amp;gt table here &amp;lt /table &amp;gt<br />
&amp;lt /div &amp;gt</p>
<p>&amp;lt p class=&#8221;flip&#8221; &amp;gt Click to view users&#8217; details &amp;lt /p &amp;gt</p>
<p>Since this  happens iteratively, we end up with as many panel/tables as there are entries, but when I click on one of the panels, all get expanded obviously because they all share the same class name, below is how the javascript bit looks like, can you please assist in this regard?</p>
<p>$(document).ready(function(){<br />
$(&#8220;.flip&#8221;).click(function(){ $(&#8220;.panel&#8221;).slideToggle(&#8220;slow&#8221;); });<br />
});</p>
<p>How do I change this such that only one panel gets to be expanded?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-79652</link>
		<dc:creator>Stefan</dc:creator>
		<pubDate>Mon, 01 Feb 2010 07:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-79652</guid>
		<description>Don&#039;t know if you sorted this one out, but you can solve it by wrapping your callback call in an anonymous function. Like so:
&lt;pre&gt;
&lt;code&gt;
var obj = this;		// Workaround for jQuery&#039;s assignment of this in ajax callback

$.ajax({
url:		&quot;ajax/ajx_load.php&quot;,
success:	function(data) {
// In this scoope this refers to the ajax settings object. Arghhh! Not what we want.

obj.load_query_cb(data);  // Problem solved! The mecanism we rely on is calld scoop chaining, I think.

},
data:		post_data,
type:		&#039;POST&#039;
});
&lt;/code&gt;
&lt;/pre&gt;

The code is from a method of my object.  load_qeury_cb() is a method of the same object. Now the ajax call works in my OOP code.</description>
		<content:encoded><![CDATA[<p>Don&#8217;t know if you sorted this one out, but you can solve it by wrapping your callback call in an anonymous function. Like so:</p>
<pre>
<code>
var obj = this;		// Workaround for jQuery's assignment of this in ajax callback

$.ajax({
url:		"ajax/ajx_load.php",
success:	function(data) {
// In this scoope this refers to the ajax settings object. Arghhh! Not what we want.

obj.load_query_cb(data);  // Problem solved! The mecanism we rely on is calld scoop chaining, I think.

},
data:		post_data,
type:		'POST'
});
</code>
</pre>
<p>The code is from a method of my object.  load_qeury_cb() is a method of the same object. Now the ajax call works in my OOP code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-79312</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Mon, 07 Dec 2009 21:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-79312</guid>
		<description>thanx a lot for this :)</description>
		<content:encoded><![CDATA[<p>thanx a lot for this :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aninda Sen</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-79311</link>
		<dc:creator>Aninda Sen</dc:creator>
		<pubDate>Mon, 07 Dec 2009 18:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-79311</guid>
		<description>great article! I am having two problems with jQuery and classic asp. I am trying to make a callback from one asp page jquery to server code in a different asp page. In that other page I am trying to fetch from the database but getting error on Server.CreateObject(&quot;ADODB.Command&quot;) line. Why can&#039;t I create  ADO object in the callback function. Is it something that I am doing wrong? Also when I do a return false from within the jquery ajax call it is ignoring the return false statement and going ahead and executing the succeeding code. How can I stop that?</description>
		<content:encoded><![CDATA[<p>great article! I am having two problems with jQuery and classic asp. I am trying to make a callback from one asp page jquery to server code in a different asp page. In that other page I am trying to fetch from the database but getting error on Server.CreateObject(&#8220;ADODB.Command&#8221;) line. Why can&#8217;t I create  ADO object in the callback function. Is it something that I am doing wrong? Also when I do a return false from within the jquery ajax call it is ignoring the return false statement and going ahead and executing the succeeding code. How can I stop that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-79190</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sat, 21 Nov 2009 11:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-79190</guid>
		<description>Scoping is one of the most annoying part of javascript and jQuery. Working OOP, you never want &lt;code&gt;this&lt;/code&gt; to be anything else than the class you are in.

in YUIs eventhandling, you can send the scope to the eventHandler to prevent the confusion. It would be great to have a OOP layer over jQuery that won&#039;t manipulate &lt;code&gt;this&lt;/code&gt; the same way jQuery does by over-using &lt;code&gt;fn.apply()&lt;/code&gt; and &lt;code&gt;fn.call()&lt;/code&gt;.

Consider this:
&lt;pre&gt;&lt;code&gt;var myOwnScope = {
    secret : &#039;Nobody knows what I am&#039;
};

jQuery.fn.addEventListener = function(type, fn) {
    $(this).bind(type, function(e) {
        fn.call(myOwnScope, e);
    })
}

$(&#039;input&#039;).addEventListener(&#039;click&#039;, function(e) {
    console.log(this);
})
&lt;/code&gt;&lt;/pre&gt;

What is &lt;code&gt;this&lt;/code&gt;? it&#039;s impossible to tell in javascript event handling. I just wished jQuery would take care of that, just as actionscript 3 took care of it from AS2, which suffered the same scoping problems as javscript has.</description>
		<content:encoded><![CDATA[<p>Scoping is one of the most annoying part of javascript and jQuery. Working OOP, you never want <code>this</code> to be anything else than the class you are in.</p>
<p>in YUIs eventhandling, you can send the scope to the eventHandler to prevent the confusion. It would be great to have a OOP layer over jQuery that won&#8217;t manipulate <code>this</code> the same way jQuery does by over-using <code>fn.apply()</code> and <code>fn.call()</code>.</p>
<p>Consider this:</p>
<pre><code>var myOwnScope = {
    secret : 'Nobody knows what I am'
};

jQuery.fn.addEventListener = function(type, fn) {
    $(this).bind(type, function(e) {
        fn.call(myOwnScope, e);
    })
}

$('input').addEventListener('click', function(e) {
    console.log(this);
})
</code></pre>
<p>What is <code>this</code>? it&#8217;s impossible to tell in javascript event handling. I just wished jQuery would take care of that, just as actionscript 3 took care of it from AS2, which suffered the same scoping problems as javscript has.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 123 test - A. Kareem Al Bosta</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-79043</link>
		<dc:creator>123 test - A. Kareem Al Bosta</dc:creator>
		<pubDate>Wed, 14 Oct 2009 00:39:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-79043</guid>
		<description>[...] of the new image to 0 so that we can fade it in using the animate() function. Finally, we attach a callback to remove the z-index classes from the previous image when animate() [...]</description>
		<content:encoded><![CDATA[<p>[...] of the new image to 0 so that we can fade it in using the animate() function. Finally, we attach a callback to remove the z-index classes from the previous image when animate() [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mabed</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-78277</link>
		<dc:creator>mabed</dc:creator>
		<pubDate>Tue, 25 Aug 2009 02:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-78277</guid>
		<description>Thank you for fixing the article. Great site!</description>
		<content:encoded><![CDATA[<p>Thank you for fixing the article. Great site!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-78265</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Mon, 24 Aug 2009 15:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-78265</guid>
		<description>Sorry about the problems with the code highlighting. Things broke when I switched web hosts. This entry is repaired. Still have to go in and fix the rest.</description>
		<content:encoded><![CDATA[<p>Sorry about the problems with the code highlighting. Things broke when I switched web hosts. This entry is repaired. Still have to go in and fix the rest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mabed</title>
		<link>http://www.learningjquery.com/2007/08/what-is-this/comment-page-1#comment-78255</link>
		<dc:creator>mabed</dc:creator>
		<pubDate>Sun, 23 Aug 2009 17:54:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/08/what-is-this#comment-78255</guid>
		<description>The code in all the articles on your site is unreadable. Is there anything I can do to get rid of the named entities? I&#039;ve tried 4 browsers already! Is this something wrong with your site.</description>
		<content:encoded><![CDATA[<p>The code in all the articles on your site is unreadable. Is there anything I can do to get rid of the named entities? I&#8217;ve tried 4 browsers already! Is this something wrong with your site.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
