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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:18:59+00:00 2026-05-24T07:18:59+00:00

i want insert some of data in database by ajax call ($.ajax()) and generation

  • 0

i want insert some of data in database by ajax call ($.ajax()) and generation tracking code by a code php and with others data it insert in database . how after (upon) insert in database, displaying to user it tracking code ? (Without Refresh Page)

With respect
my code:

$('.insert').live('click',function(e){
        e.preventDefault();
        var dataObj = $(this).closest('form').serialize();
        //alert(dataObj)
        $.ajax({
            type: "POST",
            url: 'insert_customers',
            data: dataObj,
            cache: false,
            success: function() {
                //alert(idname)
                    $('.result').hide().fadeIn('slow').html("<div class='message'>Your information was successfully. your tracking code is : '+$tracking' </div>"); 
            },
                "error": function (x, y, z) {
                    // callback to run if an error occurs
                    alert("An error has occured:\n" + x + "\n" + y + "\n" + z);
                }
        });
        return false;
    })
  • 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-24T07:19:00+00:00Added an answer on May 24, 2026 at 7:19 am

    You can send back data to the client (either html or objects) and use the data in the success function. To do so you use whatever print method that your server language uses (ie. if php use echo, perl print, etc) To print a content header and the information (like you would on a normal request for a web page. I would sugesst sending a content header of Content-type:application/json and format your data back as {"tracking":trackingVar} Then in your success function define it as:

    success: function(data) {
        //alert(idname)
        $('.result').hide().fadeIn('slow').html("<div class='message'>Your information was successfully. your tracking code is : " + data.tracking + " </div>"); 
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to insert some session data in a database. I have one table
I have some data enclosed in HTML tags. I want to insert this data
After creating a table (by migration), I want to insert some entries directly. How
here is myproblem, i want to make a php function to insert some random
I have a Microsoft SQL database, where i am trying to insert some data.
I'm trying to insert some data from a proprietary JSON database into MongoDB for
I want to save some data into sqlite database and the read it, there
I'm trying to post data with AJAX and insert it into a database table.
I exported some data from my database table into sql file as insert statements.
From my iPhone app I insert some data in my sqlite database that include

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.