<?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 Ajax delete</title>
	<atom:link href="http://papermashup.com/jquery-ajax-delete/feed/" rel="self" type="application/rss+xml" />
	<link>http://papermashup.com/jquery-ajax-delete/</link>
	<description>Ashley Ford :: CSS &#124; PHP &#124; JavaScript</description>
	<lastBuildDate>Thu, 11 Mar 2010 13:06:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ryan Woodard</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-2280</link>
		<dc:creator>Ryan Woodard</dc:creator>
		<pubDate>Wed, 24 Feb 2010 18:09:58 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-2280</guid>
		<description>Great tutorial! i cant seem to get the download to work?</description>
		<content:encoded><![CDATA[<p>Great tutorial! i cant seem to get the download to work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derleth</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-2100</link>
		<dc:creator>Derleth</dc:creator>
		<pubDate>Mon, 25 Jan 2010 02:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-2100</guid>
		<description>hello, the code works great, I&#039;m learning jquery and I have a question:
because the code is enclosed in a function?


$ (document). ready (function () (
$ ( &#039;# load&#039;). hide ();
));

$ (function () (
$ ( &quot;. delete.&quot;) click (function () (
$ ( &#039;# load&#039;). fadeIn ();
commentContainer var = $ (this). parent ();
var id = $ (this). attr ( &quot;id&quot;);
var string = &#039;id =&#039; + id;

$. ajax ((
   type: &quot;POST&quot;,
   url: &quot;delete.php&quot;
   data: string,
   cache: false,
   success: function () (
commentContainer.slideUp ( &#039;slow&#039;, function () ($ (this). ();}); remove
$ ( &#039;# load&#039;). fadeOut ();
  )
   
 ));

return false;
));
));


and not like this:


$ (document). ready (function () (
$ ( &#039;# load&#039;). hide ();

$ ( &quot;. delete.&quot;) click (function () (
$ ( &#039;# load&#039;). fadeIn ();
commentContainer var = $ (this). parent ();
var id = $ (this). attr ( &quot;id&quot;);
var string = &#039;id =&#039; + id;

$. ajax ((
   type: &quot;POST&quot;,
   url: &quot;delete.php&quot;
   data: string,
   cache: false,
   success: function () (
commentContainer.slideUp ( &#039;slow&#039;, function () ($ (this). ();}); remove
$ ( &#039;# load&#039;). fadeOut ();
  )
   
 ));

return false;
));
));


I do usually use the second form, but is there any difference?
pd: sorry if a silly question but I want to know the difference or if there is any disadvantage

PD2: sorry for my English, use google translator xD</description>
		<content:encoded><![CDATA[<p>hello, the code works great, I&#8217;m learning jquery and I have a question:<br />
because the code is enclosed in a function?</p>
<p>$ (document). ready (function () (<br />
$ ( &#8216;# load&#8217;). hide ();<br />
));</p>
<p>$ (function () (<br />
$ ( &#8220;. delete.&#8221;) click (function () (<br />
$ ( &#8216;# load&#8217;). fadeIn ();<br />
commentContainer var = $ (this). parent ();<br />
var id = $ (this). attr ( &#8220;id&#8221;);<br />
var string = &#8216;id =&#8217; + id;</p>
<p>$. ajax ((<br />
   type: &#8220;POST&#8221;,<br />
   url: &#8220;delete.php&#8221;<br />
   data: string,<br />
   cache: false,<br />
   success: function () (<br />
commentContainer.slideUp ( &#8217;slow&#8217;, function () ($ (this). ();}); remove<br />
$ ( &#8216;# load&#8217;). fadeOut ();<br />
  )</p>
<p> ));</p>
<p>return false;<br />
));<br />
));</p>
<p>and not like this:</p>
<p>$ (document). ready (function () (<br />
$ ( &#8216;# load&#8217;). hide ();</p>
<p>$ ( &#8220;. delete.&#8221;) click (function () (<br />
$ ( &#8216;# load&#8217;). fadeIn ();<br />
commentContainer var = $ (this). parent ();<br />
var id = $ (this). attr ( &#8220;id&#8221;);<br />
var string = &#8216;id =&#8217; + id;</p>
<p>$. ajax ((<br />
   type: &#8220;POST&#8221;,<br />
   url: &#8220;delete.php&#8221;<br />
   data: string,<br />
   cache: false,<br />
   success: function () (<br />
commentContainer.slideUp ( &#8217;slow&#8217;, function () ($ (this). ();}); remove<br />
$ ( &#8216;# load&#8217;). fadeOut ();<br />
  )</p>
<p> ));</p>
<p>return false;<br />
));<br />
));</p>
<p>I do usually use the second form, but is there any difference?<br />
pd: sorry if a silly question but I want to know the difference or if there is any disadvantage</p>
<p>PD2: sorry for my English, use google translator xD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derleth</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-2090</link>
		<dc:creator>Derleth</dc:creator>
		<pubDate>Fri, 22 Jan 2010 21:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-2090</guid>
		<description>gracias mi rey te amoooooooooooo
:D</description>
		<content:encoded><![CDATA[<p>gracias mi rey te amoooooooooooo<br />
 <img src='http://papermashup.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 30 Fresh AJAX Tutorials And Techniques &#187; Shai Perednik.com</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-2068</link>
		<dc:creator>30 Fresh AJAX Tutorials And Techniques &#187; Shai Perednik.com</dc:creator>
		<pubDate>Tue, 19 Jan 2010 20:21:32 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-2068</guid>
		<description>[...] jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, you can remove both a DIV and a record from the database with AJAX. In this demo, you’ll see a small red cross to the right of each comment. Clicking the cross will remove the comment’s DIV, and the slide-up animation allows you to remove the DIV. View the demo. [...]</description>
		<content:encoded><![CDATA[<p>[...] jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, you can remove both a DIV and a record from the database with AJAX. In this demo, you’ll see a small red cross to the right of each comment. Clicking the cross will remove the comment’s DIV, and the slide-up animation allows you to remove the DIV. View the demo. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 29 Fresh, Creative AJAX Tutorials And Techniques &#124; Seventy Seven</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-2037</link>
		<dc:creator>29 Fresh, Creative AJAX Tutorials And Techniques &#124; Seventy Seven</dc:creator>
		<pubDate>Sat, 16 Jan 2010 09:26:49 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-2037</guid>
		<description>[...] jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, you can remove both a DIV and a record from the database with AJAX. In this demo, you’ll see a small red cross to the right of each comment. Clicking the cross will remove the comment’s DIV, and the slide-up animation allows you to remove the DIV. View the demo. [...]</description>
		<content:encoded><![CDATA[<p>[...] jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, you can remove both a DIV and a record from the database with AJAX. In this demo, you’ll see a small red cross to the right of each comment. Clicking the cross will remove the comment’s DIV, and the slide-up animation allows you to remove the DIV. View the demo. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 30 Fresh AJAX Tutorials And Techniques &#8211; FreshTuts Tutorials, Resources, Web Trends, Code Snippets, Php scripts, Opensource, Ecommerce, Cms, Html, Xhtml scripts, Themes, Templates, Css design, Psd tuts, Photoshop, cs3</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-1989</link>
		<dc:creator>30 Fresh AJAX Tutorials And Techniques &#8211; FreshTuts Tutorials, Resources, Web Trends, Code Snippets, Php scripts, Opensource, Ecommerce, Cms, Html, Xhtml scripts, Themes, Templates, Css design, Psd tuts, Photoshop, cs3</dc:creator>
		<pubDate>Wed, 06 Jan 2010 12:43:12 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-1989</guid>
		<description>[...] jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, you can remove both a DIV and a record from the database with AJAX. In this demo, you’ll see a small red cross to the right of each comment. Clicking the cross will remove the comment&#8217;s DIV, and the slide-up animation allows you to remove the DIV. View the demo. [...]</description>
		<content:encoded><![CDATA[<p>[...] jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, you can remove both a DIV and a record from the database with AJAX. In this demo, you’ll see a small red cross to the right of each comment. Clicking the cross will remove the comment&#8217;s DIV, and the slide-up animation allows you to remove the DIV. View the demo. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 30 Fresh AJAX Tutorials And Techniques - Noupe</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-1971</link>
		<dc:creator>30 Fresh AJAX Tutorials And Techniques - Noupe</dc:creator>
		<pubDate>Mon, 04 Jan 2010 13:35:22 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-1971</guid>
		<description>[...] can be frustrating. A fix for this problem would be to use MooTools and AJAX to do the loading.jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, [...]</description>
		<content:encoded><![CDATA[<p>[...] can be frustrating. A fix for this problem would be to use MooTools and AJAX to do the loading.jQuery AJAX delete Being able to remove content with Ajax is useful for any Web designer. Using a few lines of jQuery, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wHiTeHaT</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-1962</link>
		<dc:creator>wHiTeHaT</dc:creator>
		<pubDate>Sat, 02 Jan 2010 21:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-1962</guid>
		<description>i try to insert this delete option into the  &lt;a href=&quot;http://jqueryui.com/demos/sortable/#portlets&quot; title=&quot;&quot; rel=&quot;nofollow&quot;&gt;jquery UI sortable portlets&lt;/a&gt;

The sortable portlet contents i got to work with a blocks manager system.
Jquery offers me to add an icon into the portlets header : &quot;ui-icon-closethick&quot;
I managed to get the delete function to work with the provided class from here.
But as you might figured out by above information.
I try to get this function working with the provided icon in the portlet header
Here is my javascript:
&lt;code&gt; 
	
	$(document).ready(function() {
$(&#039;#load&#039;).hide();
});

$(function() {
$(&quot;.delete&quot;).click(function() {
var commentContainer = $(this).parent();
var id = $(this).attr(&quot;id&quot;);
var string = &#039;id=&#039;+ id ;
	
$.ajax({
   type: &quot;POST&quot;,
   url: &quot;server_items_reorder.php&quot;,
   data: string,
   cache: false,
   success: function(){
	commentContainer.slideUp(&#039;slow&#039;, function() {$(this).remove();});
  }
   
 });

return false;
	});
});
$(function() {
		$(&quot;.column&quot;).sortable({
			connectWith: &#039;.column&#039;,
			update: savelayout
		});

		$(&quot;.portlet&quot;).addClass(&quot;ui-widget ui-widget-content ui-helper-clearfix ui-corner-all&quot;)
			.find(&quot;.portlet-header&quot;)
				.addClass(&quot;ui-widget-header ui-corner-all&quot;)
				.prepend(&#039;&#039;)
				.end()
			.find(&quot;.portlet-content&quot;);

		$(&quot;.portlet-header .ui-icon&quot;).click(function() {
$(this).toggleClass(&quot;ui-icon-plusthick&quot;).toggleClass(&quot;ui-icon-minusthick&quot;);
$(this).parents(&quot;.portlet:first&quot;).find(&quot;.portlet-content&quot;).toggle();
}).click();

		$(&quot;.column&quot;).disableSelection();
	});
&lt;/code&gt;

And a little php:

&lt;code&gt;

sql_query($sql);
    while(list($bid, $bkey, $title, $url, $bposition, $weight, $active, $blanguage, $blockfile, $view) = $db-&gt;sql_fetchrow($result)) {
	
?&gt;
	&lt;div class=&quot;portlet&quot; id=&quot;&quot;&gt;
	&lt;a href=&quot;#&quot; id=&quot;&quot; class=&quot;delete&quot;&gt;x&lt;/a&gt;
		
		
	
	
	


&lt;/code&gt;


I really hope to get this working</description>
		<content:encoded><![CDATA[<p>i try to insert this delete option into the  <a href="http://jqueryui.com/demos/sortable/#portlets" title="" rel="nofollow">jquery UI sortable portlets</a></p>
<p>The sortable portlet contents i got to work with a blocks manager system.<br />
Jquery offers me to add an icon into the portlets header : &#8220;ui-icon-closethick&#8221;<br />
I managed to get the delete function to work with the provided class from here.<br />
But as you might figured out by above information.<br />
I try to get this function working with the provided icon in the portlet header<br />
Here is my javascript:<br />
<code> </p>
<p>	$(document).ready(function() {<br />
$('#load').hide();<br />
});</p>
<p>$(function() {<br />
$(".delete").click(function() {<br />
var commentContainer = $(this).parent();<br />
var id = $(this).attr("id");<br />
var string = 'id='+ id ;</p>
<p>$.ajax({<br />
   type: "POST",<br />
   url: "server_items_reorder.php",<br />
   data: string,<br />
   cache: false,<br />
   success: function(){<br />
	commentContainer.slideUp('slow', function() {$(this).remove();});<br />
  }</p>
<p> });</p>
<p>return false;<br />
	});<br />
});<br />
$(function() {<br />
		$(".column").sortable({<br />
			connectWith: '.column',<br />
			update: savelayout<br />
		});</p>
<p>		$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")<br />
			.find(".portlet-header")<br />
				.addClass("ui-widget-header ui-corner-all")<br />
				.prepend('')<br />
				.end()<br />
			.find(".portlet-content");</p>
<p>		$(".portlet-header .ui-icon").click(function() {<br />
$(this).toggleClass("ui-icon-plusthick").toggleClass("ui-icon-minusthick");<br />
$(this).parents(".portlet:first").find(".portlet-content").toggle();<br />
}).click();</p>
<p>		$(".column").disableSelection();<br />
	});<br />
</code></p>
<p>And a little php:</p>
<p><code></p>
<p>sql_query($sql);<br />
    while(list($bid, $bkey, $title, $url, $bposition, $weight, $active, $blanguage, $blockfile, $view) = $db-&gt;sql_fetchrow($result)) {</p>
<p>?&gt;<br />
	&lt;div class=&quot;portlet&quot; id=&quot;"&gt;<br />
	&lt;a href=&quot;#&quot; id=&quot;" class="delete"&gt;x</p>
<p></code></p>
<p>I really hope to get this working</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-1916</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Wed, 23 Dec 2009 06:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-1916</guid>
		<description>Hello Ashley, 

Great article !
I have made a &quot;Post a comment&quot; thing, and used this article to make the delete function.

There is no problem when iam loader the page... then the delete thing works perfect.
But when iam pressing delete on a comment just added, it doesn&#039;t work.

Here is my delete part: 

$(&#039;.deletecomment&#039;).click(function() {

	var id = $(this).attr(&quot;id&quot;);
	
	$(&#039;#comment&#039; + id).fadeIn();	

	$.ajax({
		url: &quot;ajax-files/comments.php&quot;,
		data: &#039;action=delete-video&amp;id=&#039; + id,
		type: &quot;post&quot;,
		success: function(){
			$(&#039;#comment&#039; + id).fadeOut();		
		}
	});
				
	return false;
	
});

And my add part: 

$(&#039;input#addcomment&#039;).click(function() {
	
	var text 			= $(&quot;textarea#commenttextarea&quot;);
	var content 		= $(&quot;#comments&quot;); 
	var usrid			= $(&quot;input#usrid&quot;).val();
	var id				= $(&quot;input#id&quot;).val();
	var action			= $(&quot;input#action&quot;).val();
	var t 				= text.val();
	
	if (t != &#039;&#039;) {
	
		text.removeClass(&#039;active&#039;);		
		text.addClass(&#039;deactive&#039;);
		text.val(&#039;Gemmer kommentar...&#039;);
		$(&#039;input#addcomment&#039;).hide();
		text.attr(&#039;disabled&#039;, true);

		$.ajax({
			url: &#039;ajax-files/comments.php&#039;,
			data: &#039;action=&#039; + action + &#039;&amp;comment=&#039; + escape(t) + &#039;&amp;usrid=&#039; + usrid + &#039;&amp;id=&#039; + id,
			dataType: &#039;json&#039;,
			type: &#039;post&#039;,
			success: function (j) {
				
				if (content.html() == &#039;&lt;i&gt;Der er ikke nogle kommentarer.&lt;/i&gt;&#039;) {
					content.html(j.comment);	
				}
				else {
					content.before(j.comment);
				}
				
				text.removeAttr(&#039;disabled&#039;);
				text.val(commentText);
				$(&#039;#commentsamount&#039;).html(amount+1);
				$(&#039;#comment&#039; + j.id).show(&#039;slow&#039;);
			}
		});
					
	}
	else {
		text.addClass(&#039;active&#039;);
		$(this).show();											
	}
		
});

I dont know if you can see any thing out of this... Iam totally new in jQuery, this is my first script :)

Thomas</description>
		<content:encoded><![CDATA[<p>Hello Ashley, </p>
<p>Great article !<br />
I have made a &#8220;Post a comment&#8221; thing, and used this article to make the delete function.</p>
<p>There is no problem when iam loader the page&#8230; then the delete thing works perfect.<br />
But when iam pressing delete on a comment just added, it doesn&#8217;t work.</p>
<p>Here is my delete part: </p>
<p>$(&#8216;.deletecomment&#8217;).click(function() {</p>
<p>	var id = $(this).attr(&#8220;id&#8221;);</p>
<p>	$(&#8216;#comment&#8217; + id).fadeIn();	</p>
<p>	$.ajax({<br />
		url: &#8220;ajax-files/comments.php&#8221;,<br />
		data: &#8216;action=delete-video&amp;id=&#8217; + id,<br />
		type: &#8220;post&#8221;,<br />
		success: function(){<br />
			$(&#8216;#comment&#8217; + id).fadeOut();<br />
		}<br />
	});</p>
<p>	return false;</p>
<p>});</p>
<p>And my add part: </p>
<p>$(&#8216;input#addcomment&#8217;).click(function() {</p>
<p>	var text 			= $(&#8220;textarea#commenttextarea&#8221;);<br />
	var content 		= $(&#8220;#comments&#8221;);<br />
	var usrid			= $(&#8220;input#usrid&#8221;).val();<br />
	var id				= $(&#8220;input#id&#8221;).val();<br />
	var action			= $(&#8220;input#action&#8221;).val();<br />
	var t 				= text.val();</p>
<p>	if (t != &#8221;) {</p>
<p>		text.removeClass(&#8216;active&#8217;);<br />
		text.addClass(&#8216;deactive&#8217;);<br />
		text.val(&#8216;Gemmer kommentar&#8230;&#8217;);<br />
		$(&#8216;input#addcomment&#8217;).hide();<br />
		text.attr(&#8216;disabled&#8217;, true);</p>
<p>		$.ajax({<br />
			url: &#8216;ajax-files/comments.php&#8217;,<br />
			data: &#8216;action=&#8217; + action + &#8216;&amp;comment=&#8217; + escape(t) + &#8216;&amp;usrid=&#8217; + usrid + &#8216;&amp;id=&#8217; + id,<br />
			dataType: &#8216;json&#8217;,<br />
			type: &#8216;post&#8217;,<br />
			success: function (j) {</p>
<p>				if (content.html() == &#8216;<i>Der er ikke nogle kommentarer.</i>&#8216;) {<br />
					content.html(j.comment);<br />
				}<br />
				else {<br />
					content.before(j.comment);<br />
				}</p>
<p>				text.removeAttr(&#8216;disabled&#8217;);<br />
				text.val(commentText);<br />
				$(&#8216;#commentsamount&#8217;).html(amount+1);<br />
				$(&#8216;#comment&#8217; + j.id).show(&#8217;slow&#8217;);<br />
			}<br />
		});</p>
<p>	}<br />
	else {<br />
		text.addClass(&#8216;active&#8217;);<br />
		$(this).show();<br />
	}</p>
<p>});</p>
<p>I dont know if you can see any thing out of this&#8230; Iam totally new in jQuery, this is my first script <img src='http://papermashup.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashley</title>
		<link>http://papermashup.com/jquery-ajax-delete/comment-page-1/#comment-1764</link>
		<dc:creator>Ashley</dc:creator>
		<pubDate>Fri, 27 Nov 2009 08:46:38 +0000</pubDate>
		<guid isPermaLink="false">http://papermashup.com/?p=866#comment-1764</guid>
		<description>@sam, thats odd can you zip up your files and email them to me ashley at dotdashcreate dot com? i can take a look for you.</description>
		<content:encoded><![CDATA[<p>@sam, thats odd can you zip up your files and email them to me ashley at dotdashcreate dot com? i can take a look for you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
