Ajax success function not executing after getting response : <p>Following is my code:</p>

<pre><code>$(".simpleCart_shelfItem button").click(function() {
            $(this).prop('disabled', true);
            $(this).addClass('disabled');
            $(this).html("Adding &amp;nbsp;&amp;nbsp;&lt;i class='icon-spinner9 spin'&gt;&lt;/i&gt;");

            var action = "add";
            var queryString = "action="+action+"&amp;pid="+this.value;

            $.ajax({
                    url: "add_cart",
                    data: queryString,
                    type: "POST",
                    success:function(data){
                        if(data == 1)
                            {
                                $(this).prop('disabled', false);
                                $(this).removeClass('disabled');
                                $(this).html("Added In Cart");
                            }
                    },
                    error:function (){}
                });
        });
</code></pre>

<p>I am having 6 products on a page. If a user click on Add To Cart button for a particular product then this code will execute and send request to server.</p>

<p>The code is executing fine, i am even getting the response.</p>

<p>Problem is this even after getting the response the success function is not executuing i.e this code is not executing..</p>

<pre><code>$(this).prop('disabled', false);
$(this).removeClass('disabled');
$(this).html("Added In Cart");
</code></pre>

<p>It only executes the code which it was meant on entering the click function i.e this code:</p>

<pre><code>$(this).prop('disabled', true);
$(this).addClass('disabled');
$(this).html("Adding &amp;nbsp;&amp;nbsp;&lt;i class='icon-spinner9 spin'&gt;&lt;/i&gt;");
</code></pre>

<p>And then it freezez on the above code.</p>

<p>The success function is not being executed.</p>
