[jQuery] Callback on $.Post not firing
This is driving me loopy. Simple post, trying to get a result back from the server. Heck even copied it from the documentation and the callback just will not fire, but the post works fine: var answer = confirm(Delete Selected?); if (answer){ $.post(test.php, { name: test }, function(data){ alert(popped off!); alert(data.name); // John console.log(data.time); // 2pm }, json); } PHP: ?php echo json_encode(array(name=John,time=2pm)); ? I also tried with XML with no luck either. Firebug doesn't seem to show a response, but I know the post variables are passed just fine, because I wrote a logger [not included] to tell me what the variables where being passed. No dice on the return info. Tried this with both firefox and opera and in neither the call-backe worked. Ideas?
[jQuery] Re: Callback on $.Post not firing
Ok did that but still not getting anything from the errors: $.ajax({ type: POST, url: test.php, data: {name: test}, dataType: json, error: function (XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest: + XMLHttpRequest); alert(textStatus: + textStatus); alert(errorThrown: + errorThrown); }, success: function(msg){ alert( Data Saved: + msg ); } }); XMLHttpRequest: XMLHttpRequest object; textStatus: error; and errorThrown: undefined Am I going about this the wrong way? On Nov 24, 3:47 pm, Andy Matthews [EMAIL PROTECTED] wrote: Is it maybe generating an error? Try converting to a .ajax call so that you've got access to the error method handlers. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rage9 Sent: Monday, November 24, 2008 3:43 PM To: jQuery (English) Subject: [jQuery] Callback on $.Post not firing This is driving me loopy. Simple post, trying to get a result back from the server. Heck even copied it from the documentation and the callback just will not fire, but the post works fine: var answer = confirm(Delete Selected?); if (answer){ $.post(test.php, { name: test }, function(data){ alert(popped off!); alert(data.name); // John console.log(data.time); // 2pm }, json); } PHP: ?php echo json_encode(array(name=John,time=2pm)); ? I also tried with XML with no luck either. Firebug doesn't seem to show a response, but I know the post variables are passed just fine, because I wrote a logger [not included] to tell me what the variables where being passed. No dice on the return info. Tried this with both firefox and opera and in neither the call-backe worked. Ideas?
[jQuery] Getting all checked check boxes with a certain id
I'm trying to get the values of all checked check boxes in a certain section of a page. Each of the check boxes has the same id, I could just as easily make it a class or whatnot. I'm using something like: var valArray = $('#' + id + ' input:checkbox').serializeArray(); Although I know the above isn't right, what is the proper query to do this? Thanks in advance.
[jQuery] Destroying parent tag when restoring original value.
Having a heck of a time figuring this out, I have made a few fields (td'seditable, so when you click on them it puts in a form with a text box and a button to submit, and a button to undo it. Well when I undo it, everything looks fine but the data is trapped in another set of td tags. Is their anyway to kill off these extra td's, because this can keep happening every time someone clicks on it and undoes it. Code: function setClickableTitle(obj, i) { $(obj).click(function() { var account = $(obj).attr('accountno'); var id = $(obj).attr('id'); var title = $(obj).attr('title'); var revert = $(obj).html(); var test = code that goes into the td just clicked; $(obj).after(test).remove(); $('.titleClose').click(function(){stepBackTitle(this, revert, i, id, title, account);}); }); function stepBackTitle(obj, revert, n, id, title, account) { $(obj).parent().replaceWith(td id=' + id + ' title=' + title + ' accountno=' + account + ' + revert + /td); setClickableTitle($(td[title]).get(n), n); }; }