Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6238569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:14:23+00:00 2026-05-24T11:14:23+00:00

Maybe i get minuses for this question, but i have problems with success and

  • 0

Maybe i get minuses for this question, but i have problems with success and i really don’t see differences between example of using success from jQuery documentation:

$.ajax({
  url: "test.html",
  context: document.body,
  success: function(){
    $(this).addClass("done");
  }
});

and my code:

$('#my_form').live('submit', function(){
    var data = $("#form_for_item").serialize();
    var url = '/something/add_something/' + $('#form_for_item').attr('name') + '/';
    $.ajax({
        type: 'POST',
        url: url,
        data: data,
        success: function(){
            alert('problem!')
        },
        dataType: 'json'
    });
    return false;
});

For more i can say that data is sent via post and save in my database, and for more than more i can say that when i have success: alert('problem!') there is no problem.
What is wrong with my success?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:14:23+00:00Added an answer on May 24, 2026 at 11:14 am

    Perhaps your server isn’t returning JSON data. Usually you can leave it up to $.ajax to figure out what sort of data the server is responding with by checking the Content-Type header and possibly other means. Try dropping the dataType.

    Also, using:

    success: alert('problem!')
    

    Gets you your alert because that will be executed while the $.ajax call’s options object is being built and there won’t be a success callback at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Variations of this question have been asked before, but it seems like the issue
I actually don't even know how to call this :P, but... I have one
Maybe it's just too early but I can' figure out why I can't get
I didn't quite get / see what I was hoping for and maybe missed,
I want to get the system icon of a specified folder, but maybe the
I'm trying to do multithread uploads, but get errors. I guessed that maybe it's
May be my question is stupid. But i would like to get it cleared.
My question is sort of a follow on from this question below but I
I am really suffering here trying to get this ajax call to work, sorry
This may be kind of a simple question, but I haven't seen a direct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.