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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:36:07+00:00 2026-06-02T15:36:07+00:00

i am writing a online text editor application, and i need to save data

  • 0

i am writing a online text editor application, and i need to save data to mongo db every 3 minutes after last key press by user currently i am saving data after the textarea loses focus thats fine but i need to add more user friendly features so i need to add the above functionality but i cant figure out how to go about it i need a timer in jquery which can trigger the ajax call after 180 sec. Can anyone tell me which jquery function i can use to get the desired result. i am using on server side and mongo db as database.

  • 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-02T15:36:09+00:00Added an answer on June 2, 2026 at 3:36 pm
    window.setInterval(function() {
        $.ajax({...});
    }, 180000);
    

    However, I’d use an approach that only saves when necessary, and in this case more often. The following example uses functions from Underscore.js.

    $('textarea').on('keyup', _.throttle(_.debounce(function() {
        $.ajax(...);
    }, 2000), 60000));
    

    This will save your data as soon as the user stops typing for at least 2 seconds, but not more than once every minute. Here’s a small example which saves every 2s after a modification every 10 seconds: http://jsfiddle.net/ThiefMaster/AagFC/

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

Sidebar

Related Questions

I'm writing an online application where I save some texts to the database. There
By blog-editor i mean text-editors that are used to write blogs online. Example would
I'm writing an app to view an online web text-based game. I want to
I am writing an MFC C++ application that has a Save As button for
When writing an application to work offline and online is it best to write
I am writing a WPF application that I need to authenticate with our current
I'm writing an online project asset tracker but I'm new to MySQL. What would
I'm writing a game for iPhone, and I want an online leaderboard using mySQL,
Writing a .NET DLL how do I find Application.ProductName ? EDIT: Obviously, importing Windows.Forms
Writing my first C# application...never touched the language before and not much of a

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.