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 8008461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:08:47+00:00 2026-06-04T18:08:47+00:00

I have sent a jquery-ajax request and it’s the response was true but i

  • 0

I have sent a jquery-ajax request and it’s the response was true

but i need to change the value of a selected item on the page but neither the action takes place nor the the alert alerts

like :

$('#rename').click(function () {
//alert( $(this).closest('td').prev().prev().text());
var name = prompt('enter the new name');
if (name) $.ajax({
    url: url() + '/rename',
    type: 'POST',
    data: { value: name,
        id: $(this).closest('tr').find('td :first').attr('value')
    },
    success: function (result) {
        if (result.content == 1) {
            //location.reload();
            alert(name);
            //$(this).closest('td').prev().prev().text(name);
        } 
    }
})
})  

what do you think to overcome that issue ?

  • 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-06-04T18:08:49+00:00Added an answer on June 4, 2026 at 6:08 pm

    this should help you debug the issue

    $('#rename').click(function () {
        //alert( $(this).closest('td').prev().prev().text());
        var name = prompt('enter the new name');
        if (name) $.ajax({
            url: url() + '/rename',
            type: 'POST',
            data: { value: name,
                id: $(this).closest('tr').find('td :first').attr('value')
            },
            success: function (result) {
                alert('success');
                if (result.content == 1) {//location.reload();
                    alert(name);
                    //$(this).closest('td').prev().prev().text(name);
                }
            },
            error: function () {
                alert('error');
            }
        })
    });
    

    basically added a couple of extra points.

    1. How do you know success is happening and result.context just isn’t equal to 1, so added the alert('success');
    2. How do you know it’s resturning success at all? Added

      error: function () {
      alert(‘error’);
      }

    3. you were missing a ; at the end. 🙂

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

Sidebar

Related Questions

I have used jquery tabs for loading data with ajax, but I need to
I have a server-sent events handler in ASP.NET Response.ContentType = text/event-stream; while (true) {
i'm using jQuery for sending ajax requests to the server, but i have some
I have an jquery ajax request that calls a PHP script that will send
I have a jQuery Ajax request, that I want to call with text input,
Is there any solution to detecting if a POST have been sent with jQuery?
I have the following jquery function that submits to an iframe. The message sent
I have a linux C program that handles request sent to a TCP socket
I have a jQuery .ajax call: $j.ajax({ type: POST, url: /Services/Cart.asmx/UpdateQuantity, data: data, contentType:
I am using Jquery form plugin to upload file in Ajax request.File is successfully

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.