how to refresh particular div on master page by javascript?
in that div i have one label which display the total number of records.. i want to update it continously without reload the whole page
for example, facebook notification..
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Nov 12, 2013, 8:45 PM EST
You can use UpdatePanel.
Here is an example
Hardik PatelRank #4,439 · 343 reputationPosted Nov 12, 2013, 9:08 PM EST
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Nov 12, 2013, 11:27 PM EST
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Nov 12, 2013, 11:55 PM EST
CSS:
.text {
color: Green;
font-weight: bold;
}
JS:
var elem = $('.text');
var count = 0;
function updateLabel() {
elem.html(count++);
}
updateLabel();
// span will be updated 2 seconds once.
myCounter = setInterval(updateLabel, 2000);
HTML:
Some text
Here is an live example
Hardik PatelRank #4,439 · 343 reputationPosted Dec 19, 2013, 2:04 AM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 19, 2013, 2:36 AM EST
hi,
Jquery has load method for div. if you have url and from this url you want to refresh div than you can use this option.
Please refer for more info.
http://api.jquery.com/load/
hope this will help you.