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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:31:57+00:00 2026-05-30T12:31:57+00:00

When i submit a jquery ajax request without the data value, it works, when

  • 0

When i submit a jquery ajax request without the data value, it works, when i submit it with the data value, nothing happens. I check if it works using firebug. I think its a simple mistake but i cant seem to figure it out. Please Help.

Here is the Jquery Code

var inputString = $("something").val();
var suggestions = $.ajax({
    url: "temp.php",
    type: "POST",
    data: {valueInput : inputString},
    dataType: "html"
});

temp.php just has some simple code since I’m testing:

    echo "We got sumn here";

another thing is the suggestions variable is empty, any ideas?

  • 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-30T12:31:59+00:00Added an answer on May 30, 2026 at 12:31 pm

    You can try:

        data: 'valueInput=' + encodeURIComponent(inputString),
    

    Update

    suggestions is being set to the jqXHR object returned from the $.ajax() function. If you want to do work on the server-response then you need to set a success callback somehow. Here are two ways:

    var inputString = $("something").val();
    $.ajax({
        url      : "temp.php",
        type     : "POST",
        data     : 'valueInput=' + encodeURIComponent(inputString),
        dataType : "html",
        success  : function (serverResponse) {
            //you can now do work on the server-response, it's stored in the serverResponse variable
            alert(serverResponse);
        }
    });
    

    OR

    var inputString = $("something").val(),
        suggestions = $.ajax({
        url      : "temp.php",
        type     : "POST",
        data     : 'valueInput=' + encodeURIComponent(inputString),
        dataType : "html"
    });
    $.when(suggestions).then(function () {
        //this is your callback function
    });
    

    I suggest the first method, the second is more advanced and is really only helpful if you want to wait for a set of AJAX requests to complete before doing something.

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

Sidebar

Related Questions

When using jQuery 's ajax method to submit form data, what is the best
I'm using Jquery to submit the value of a <textarea> through AJAX to a
I have a strange error where my jquery ajax request doesn't submit all the
i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I'm using jQuery.ajax() to make a PUT request to a REST web service, but
I am using JQuery to perform form submission through an ajax request. I use
I am using Jquery form plugin to upload file in Ajax request.File is successfully
I'm trying to submit a simple jQuery ajax call but using the DELETE method
Currently Im trying to do ajax request using jQuery Mobile. I`m trying to use
I am using jquery ajax api to submit (POST/GET) a text as parameter to

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.