> So why doesn't my success callback excutes? > > ---------------- > $(document).ready(function(){ > $('.error').hide(); > $(".voteBtn").click(function() { > var poll = $("inp...@name='poll']:checked").val(); > alert("send: "+poll); > if (poll == 'undefined') { > alert("don't post"); > $("label#poll_error").show(); > return false; > } > > var question_id = $("inp...@name='question_id']").val();; > var t = $("inp...@name='t']").val(); > > var dataString = 'poll=' + poll +'&question_id='+question_id > +'&t='+t; > alert("send: "+dataString); > $.ajax({ > type: "POST", > url: "poll-process3.php", > data: dataString, > success: function() { > alert("why not "); > $("#poll-container").hide(); > } > });//end ajax > > });//end click/**/ > if ($("#poll-results").length > 0 ) { > animateResults(); > }});//end ready > > ------------------- > > all alert are shown except "why not", but poll-process3.php is being > executed.
Does Firebug indicate a scripting error? If not, does it show the data being posted to the server? What is the default action of the voteBtn element? Does it cause a page navigation? You should probably return false from that click handler. Also, if you are using jQuery 1.3.x then you should remove the @ in your selectors. It is no longer supported. This: $("inp...@name='t']") should be: $("input[name=t]")