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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:03:29+00:00 2026-05-21T15:03:29+00:00

I have some data that I want to show using JQuery but don’t know

  • 0

I have some data that I want to show using JQuery but don’t know how to show it. I have a search box where the user types a search term, then when it’s submitted, if found, a div would be shown with the data. If the search term was not found, the div should not be shown.

I know how to do this when the page refreshes but how to do this without a page refresh. Can someone please point me to an example?


EDIT:

This is what I am currently using. I’m really new to JQuery so some of the examples that have already been posted seem a bit different. I’m not really sure which example would work for me.

$.ajax({
  type: "POST",
  url: "http://site.com/search.php",
  data: dataString,
  dataType: 'json',
  success: function(data) {
    if(data.success == 1){
      alert('success');
    }else{
      alert('fail');
    }
  }
});
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-21T15:03:29+00:00Added an answer on May 21, 2026 at 3:03 pm

    You need to use jQuery.ajax (if you want to do it without a refresh). Something like this should work:

    jQuery("#mySearchForm").submit(function() {
    
        var searchTerm = jQuery("#mySearchInput").val();
        jQuery.ajax({
            url: "http://my.url.com",
            data: searchTerm,
            dataType: "json", //assumes your return data-type is json
            success: function(data, textStatus, jqXHR) {
               //assumes your json has a property called response
               jQuery("#myDiv").html(data.response); 
            },
            error: function(jqXHR, textStatus, errorThrown) {
               //error-handling code
            }
        });
    
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data that I want to store somewhere in my Rails app
I have some data. I want to go through that data and change cells
I have some existing code that retrieves data from a database using ADO.NET that
I have some nested tables that I want to hide/show upon a click on
We have some input data that sometimes appears with &nbsp characters on the end.
I have some configuration data that I'd like to model in code as so:
I have some scientific image data that's coming out of a detector device in
I have a file which is an XML representation of some data that is
I have a Rails app that will post some data to another Rails app.
I have created an application that writes some data to the root folder of

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.