May 6, 200917 yr I have this ajax request, and i've used this dozens of times, and never had a problem, until today, and i can't sus it. I thought it could be because i've stopped using jquery 1.2.6 and moved to 1.3.2, but i tried it on 1.2.6 and it still doesn't work. $.ajax({ type: "POST", url: "contact.php", data: dataString, success: function() { $('#contact_form').html("<div id='message'></div>"); $('#message').html("<h2>Thank you for your enquiry</h2>") .append("<p>I will be in touch soon.</p>") .hide() .fadeIn(1500, function() { $('#message').append(); }); } }); It's sending the request succesfully the the php file, i've checked with firebug, and i'm getting a successful server response, and the email is sending, but the function won't execute, and i don't know why? Anyone got any idea's? Firebug Shows no errors, all browsers successfully send emails, but none execute the function.
May 6, 200917 yr Author Hmm, ok i've narrowed it down to a problem with the function, if i replace it with { alert (dataString); } Then it runs, idk why it doesn't work, it shows no errors, and the other times i've ran the function it's fine, so *shrugs* I'll re-write it, maybe there's a conflict, but surely firebug would show it? Although my confidence in firebug is shattered, because it always returns this in the console now [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDocShell.canvasHasFocus]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsSessionStore.js :: sss_saveState :: line 1909" data: no] [Break on this error] this._writeFile(this._sessionFile, oState.toSource()); If anyone knows what the above is, i'd love to know how to fix it? EDIT: GAH!!! i fixed it, it was just a typo *sigh*
May 22, 200917 yr Author Late (just a tad) but incase anyone want's to nab this, there's no typo in the actual script itself. $('#contact_form'). was referenceing <form id="contact-form" /> Notice the id has a hyphen, whereas i was trying to select it with an underscore. I'm forever making that mistake.
Create an account or sign in to comment