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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:44:17+00:00 2026-05-16T22:44:17+00:00

i managed to to get this script. It’s refreshing the div of the dialog

  • 0

i managed to to get this script. It’s refreshing the div of the dialog window:

function getRandom() {
$("#category_dialog").load("<?php echo $category; ?>", '', callback);

}

function callback() {
    $("#category_dialog").show("fast");
    setTimeout("getRandom();", 10000);
}

$(document).ready(getRandom);

everything works fine. div gets refreshed every 10 seconds. But i have some doubts about this method.
1. since is doing a refresh at any 10 seconds will slow down the speed of the borwser or something like this?
2. I would like to make it refresh more faster at every 3 seconds could anything bad happen?

I would prefer to make somehow a link that will refresh the content onclick — but i couldn’t find any good examples. Can someone help me out with this.
So i want the category_dialog div be loaded using load.() but with onclick call — and display then whats new.
Thanks!


With Kissaki help i managed to make a simple function that will make me a refresh link 🙂
here’s the sample:

$(function() {
  $("#refresh").click(function() {
     $("#category_dialog").load("<?php echo $category; ?>")
  })
})
  • 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-16T22:44:17+00:00Added an answer on May 16, 2026 at 10:44 pm

    If you want to decrease the refresh interval you only have to consider performance: bandwidth, server load and client load.

    Client load shouldn’t be a problem, if it’s not a useless refresh in the background. You could for example only refresh if the window has focus to reduce pulling useless, never seen data.

    As the div is shown once and you call the show function each time you refresh (while it’s still shown, as it was never hidden) you may remove that call. I’m not quite sure how jQuery implemented it and how much of a performance gain you can get here, but it’s a useless call after the first call anyway.

    You could also probably use this in the callback function, as you’re using the load function. You’d have to check though.

    Also, you don’t need to pass an empty string to the load function. That data parameter is optional.

    And as I see no content update, you probably dropped that from the code before pasting here?

    For the onclick jQuery provides the click() function http://api.jquery.com/click/

    $("#category_dialog").click(function(event){
      //refresh code here
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a call with this script, but am getting a
I am using the Telerik autocomplete option In the header: <script type=text/javascript> function onAutoCompleteDataBinding(e)
I just managed to get py2exe work on a Windows Virtual Machine but stumbled
I have been trying to do this all day. At the end i managed
My php script sends back a JSON encoded string. I'm just lost on how
By following the official instructions http://www.mongodb.org/display/DOCS/Quickstart+Unix and this post http://blog.phy5ics.com/2010/03/27/installing-mongodb-on-mediatemple-dv/ I've just about managed
I would like a batch script to all the text documents in a folder.
I'm juuuuuust trying to get an pop up displaying test when the document is
I have a chart in excel that represents some value over a one day
I'm trying to execute classic ASP pages on a windows 2008 64 bit R2

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.