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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:05:28+00:00 2026-05-26T03:05:28+00:00

I have this ajax call, which works for the most part, but it does

  • 0

I have this ajax call, which works for the most part, but it does seem to memorize the previous result. Edit: this likely is due to binding a behavior to a divid.

The structure of my routine is like this:

  1. call ajax to search if the input is good or not, get response back from php. Result can be either Yes or No.

  2. If result is Yes, change the color of a holder div as a visual cue, allow user to doubleclick on the div to run another function. If not, don’t allow doubleclick div and don’t run another function.

Easy right? Except that when the first ajax call yields a ‘Yes’ result, and then the user perform a second ajax call and it yields a ‘No’ result, the user can dblclick on ‘No’ result and perform the action intended for a ‘Yes’ result.

I try to unbind the dblclick, but it does not seem to work, and would still allow the no result to be clicked on. This is my jquery code, my regular javascript code has the same bad behavior.

Edit: this appears to be a binding problem. But I can seem to unbind and destroy/delete the previously bound behavior. Further testing by repeating the routine seem to indicate that javascript does save these bound objects in memory because the alert would echo back as many “saved” bound objects when I repeated the error routine many times.

My partial code is below, any insight is appreciated.

TIA

Edit: the solution is to unbind the doubleclick, I should had type dblclick instead of doubleclick

function search(input,divid) {

var queryString = "name=" + input+"&divid="+divid;
var url = "../l.php";

      $.ajax({
      type: 'get',
      url: url,
      data: queryString,
      cache: false,
      dataType: 'text',
      timeout: 10000, 

      error: function(xhr, status, error) { alert('Search Error: '+ xhr.status+ ' - '+ error); },

      success: function(response) { 

      var result = response;
      var err = /:/;
      var divid = "#"+divid;


      if (result == "Yes" ) 
      { 
        $(tldid).attr({'class':'tg1', 'title':'Doubleclick to save'});

        var testword = 'xyz';
        $(divid).dblclick(function() {
            alert (testword);

                    $(divid).unbind('doubleclick');
                   });

       else {
         //alert (testword +" should not have been passed here, but it does");
                 $(divid).attr({'class':'tg2'});
        }


      }//success
    });

}//end 
  • 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-26T03:05:29+00:00Added an answer on May 26, 2026 at 3:05 am

    You should change $(divid).unbind('doubleclick'); to $(divid).unbind('dblclick');.

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

Sidebar

Related Questions

I have this javascript routine for ajax call, which works for the most part.
On my main page I have this jquery code which does an ajax call
I have the following ajax call which works perfectly in Firefox and Chrome but
I have this AJAX code, but it doesn't seem to throw the 'alert' method.
I have created code which works, it posts, an ajax call. It also posts
I have this code which works. $.ajax({ type: GET, url: includes/process.php, data: captcha= +
I have a jQuery $.ajax call which works fine in all major browsers. Additionally
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
I have the following ajax call var prev_sibling = $(this).prev().attr(value); var next_sibling = $(this).next().attr(value);
I have a web service that returns this string via the jQuery $.ajax() call

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.