Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can't sus this, ajax request working but not showing success

Featured Replies

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.

  • 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*

  • 3 weeks later...
  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.