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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:08:41+00:00 2026-06-03T12:08:41+00:00

I have a piece of JQuery AJAX that calls a VB.NET code-behind (class) that

  • 0

I have a piece of JQuery AJAX that calls a VB.NET code-behind (class) that returns string data. It grabs some latest stats on a particular server. Now the code works, but the first time I press the refresh button data is returned and the alert “Refreshed” is shown on screen.

But if I press it again, the alert box “Refreshed” is shown twice, I click again three times! and on and on, until the time-out kicks in.

It seems to be coming from the AJAX call and no where else. I’m at a loss at what could be calling this, I’ve tried deleting the data returned after success but no joy. Any ideas on what could be causing this or where to look?

function RefreshServer(btn,div,id,ip) {

$('#aRefresh'+id).html("<img src=images/refreshServer.gif border=0 align=absmiddle />");
$("#"+btn).click(function() {
$.ajax({
  type: "POST",
  url: "Dashboard.aspx/refreshServerAJAX",
  timeout: 5000,
  data: "{'IP': '" + ip + "'}",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function(msg) {
    var substr = msg.d.split('%');
    $('#serverBox_mod'+id).html(" " +substr[0]);
    $('#serverBox_map'+id).html(" " +substr[1]);
    $('#serverBox_playing'+id).html(" " +substr[2] + "/" + substr[3]);
    $('#serverBox_img'+id).html("<img src=images/Maps/" + substr[4] + " height=80 width=120 border=0 style=margin-top:10px;margin-bottom:10px; />");
    $('#serverBox_title'+id).html(" " +substr[5]);
    $('#aRefresh'+id).html("Refresh");
    delete substr
    delete msg
    alert("Refreshed");  
  },
  error: function(msg) {
    $('#aRefresh'+id).html("Refresh");
    $('#serverBox_title'+id).html("Server didn't respond!, sorry about that. Please try again...");
  }
});
});  
}
  • 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-03T12:08:42+00:00Added an answer on June 3, 2026 at 12:08 pm

    I guess you are binding the click event everytime you call the function. So it is making that many number of ajax calls to the server page. So If you want to keep the code structure as it is and fix it, I would unbind the click event already added and bind it again.

    function RefreshServer(btn,div,id,ip) {
    
      $("#"+btn).unbind('click');
      $("#"+btn).click(function() {
         //your ajax code is here
      });
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have grabbed some XML data using this piece of jQuery: $.ajax({ type: POST,
I have a piece of jQuery code that fills an element on the page
I have a piece of jquery code that isn't firing correctly in IE (8
The situation is that I have a page that uses some AJAX calls to
I have the following piece of code <html> <head> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script> <script> $('body').on('click', 'a.wishlist_item',
Here's my problem, I have a piece of jquery that works fine in modern
So I have a piece of code: jQuery.fn.center = function(parent) { parent = this.parent();
I'm using jQuery with rails and have the following piece of code $('#related').html(<%= render
I have this piece of code that does not work: public CartaoCidadao() { InitializeComponent();
I have this piece of code that works fine in subsonic 2.2, I migrated

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.