
Hi all! Is there anyone out there who is adept with jQuery, javascript and AJAX? I have an ajax call in the application that I am working on that is the root of a Heisenbug that is causing me some grief! I have pruned the call to the collowing code: <code> function addPublication ( pubID, pubName, pubCategories ){ alert ( "in addPublication" ); var xhr = $.ajax ({ url: "/publisher/ajax/addpub.php", type: "POST", data: ({ id: pubID, name: pubName, "categories[]": pubCategories }), success: function(){ alert ( "We're Back from addpublication" ); } }); alert ( "*" + xhr.responseText + "*" ); }; </code> The post that is generated from this is correct and if I manually send that post data to the php script I get the expected results (at the moment all the script does is generate an empty page with a "print_r" of the post data. However, the ajax call randomly returns correctly or returns with "error - undefined error." Firebug is distressingly unhelpful in that all it does is show the url in red in the console and no errors or anything! I have found on occasion that erasing the url and retyping it exactly will cause the bug to disappear but any editting of the js file after that will cause the bug to return. The ironic thing is that when I have the full function of the php script activated it actually does the task that it is supposed to do correctly - except that I have to refresh the page to see the result instead of the ajax refreshing the page properly. Argh! can anyone shed some light? -- James Pluck A Cruce Salus Charles de Gaulle - "The better I get to know men, the more I find myself loving dogs." - http://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html

Hi James Can you put it on a public web server for us to have a gander at? Cheers Shannon
participants (2)
-
James Pluck
-
Shannon Skinner