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

  • SEARCH
  • Home
  • 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 8438863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:50:10+00:00 2026-06-10T07:50:10+00:00

I am sending post data to saveworld.php and getting some result in that page

  • 0

I am sending post data to saveworld.php and getting some result in that page and I
want to use that data in the present page .My problem is I am getting the entire DOM
of saveworld.php.But I need only some specific text in a div having an id as linkid

this is my code

$.ajax({
    type: "POST",
    url: "saveworld.php",
    data: worldData,
    success: function(data) {
        if (data.length > 0) {
            $('#space').append("<a id='" + data + "' class='square' style='background-color:#" + color2 + ";color:#" + tcolor2 + ";' href='worlds/" + data + "'>" + name2 + "</a>")
        }
    }
});​

i want a specific data for example I want the following data which was present in saveworld.php

<div id='linkid'>23</div>

I suppose it will be something like ($('#linkid',data)) to get that data but I am getting [Object Object ] using that
But I want to use the specific part of the data of the response page saveworld.php

  • 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-10T07:50:12+00:00Added an answer on June 10, 2026 at 7:50 am

    If your php script return a piece of JSON code, you have to decode your JSON like that :

    var res = $.parseJSON(data);
    

    And after you can use your data as you rendered your table on your PHP script :

    res.MyFirstVar;
    

    The better way to your php script is to test if your piece of code was executed well.
    You render a php table with a bool for the execution check test:

    $result = array();
    $result['ok'] = false;
    /* do something */
    if( //all is ok )
    {
    $result['ok'] = true;
    }
    render_json($result); //choose your way to render the json
    

    on your js code, it will look like :

    $.ajax({
    type: "POST",
    url: "saveworld.php",
    data: worldData,
    success: function(data){
    var res = $.parseJSON(data);
     if (res .ok){ 
    
    $('#space').append(
        "<a id='" + res.linkid + "' class='square' style='background-color:#"+ color2 +  ";color:#" + tcolor2 + ";' href='worlds/" + res.linkid + "'>"   
         + res.name2 + "</a>"
    )
    }else{
    //notify the use that failled
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that's sending some POST data in plaintext to an aspx
I'm using C# to POST some data to a webserver running PHP. I'm sending
I'm having some problems with sending POST data to a PHP script with NSURLConnection.
When sending data via POST or GET with jQuery you use for format {
I plan to use java.util.zip to compress http post data when sending it from
I am trying to send the POST data from java to a PHP page.
How can I intercept the post data a page is sending in FF or
I am sending post data via ajax, and that data looks like this: var
I have a problem sending POST request with VB6. The code below works properly
I have a problem with sending POST http request. It stops on (HttpWebResponse)request.GetResponse() and

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.