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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:41:13+00:00 2026-06-05T00:41:13+00:00

I do a search by the js for my site. Their code it might

  • 0

I do a search by the js for my site.

Their code it might look like:
have a form and when the keyup event, it will send post to a file and retrieve data from that file into the html of a div crazy.

but this yourself in trouble. I find the example for “a” is about 3000 results. for example, take a second to send post. so I press “c” will now send the post to the file is “ac” and there are 100 such results takes 0.3 seconds.
eg time I press the letter “a” to “c” 0.2 seconds, it should show results “ac” at 0.5 seconds. then 0.5 seconds later it is the result of “a”. ~> Find “ac” into finding “a”
So how do you now when you press “c” then it stopped send post with the value “a” that send post with value “ac”.

<form method="post" onsubmit="return checkForm(this.form)">
<div class="search padding">
    <input type="text" id="searchbox" name="manga_name" class="input" value="Tìm truyện muốn đọc ..." onfocus="if (value =='Tìm truyện muốn đọc ...'){value =''}" onblur="if (value ==''){value='Tìm truyện muốn đọc ...'}" />
    <input type="submit" value=" " id="searchsubmit" class="go"/>
</div>
    </form>

<div id="result"></div>

And the script:

<script>
$('#searchbox').keyup(function() {
 search();
});

function search() {
var keyword = $('#searchbox').val();
if (keyword != "") {
$('#result').html(loadingText);
$('#result').css('display', 'block');
$.post('/search/',{"keyword":keyword}, function(data){
if (data != "")
{
$('#result').html(data);
}
else
{
$('#result').html('');
$('#result').css('display', 'none');
}
});
}
else {
$('#result').html('');
$('#result').css('display', 'none');
}
}
</script>
  • 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-05T00:41:15+00:00Added an answer on June 5, 2026 at 12:41 am
    // use to delay the callback execution
    // so your search will be executed only you stop typing after 0.5(500 ms for example) second
    var delay = (function(){
      var timer = 0;
      return function(callback, ms){
        clearTimeout(timer);
        timer = setTimeout(function() {
          callback();
        }, ms);
      }
    }());
    
    $('#searchbox').keyup(delay(search, 500));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site where users will first enter their search criteria. The search
The behavior I propose: A user loads up my search page, www.site.com/search, types their
I have a site search (using Examine & Razor) that breaks if a space
I have signed up(paid) for Google site search. They have me a url of
I have been tasked with creating a site wide search feature. The search needs
I have a problem with my search on my site I don't understand why
Alright...I've given the site a fair search and have read over many posts about
i have an odd request from someone to help them NOT have their site
I am using google site search which is an API I purchased where I
I am trying to integrate a site search feature into a client's site. I've

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.