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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Dec 19, 2013, 7:36 AM
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.
Hardik PatelPosted Dec 19, 2013, 7:04 AM
Jaganathan BantheswaranPosted Nov 13, 2013, 4:55 AM
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
Jaganathan BantheswaranPosted Nov 13, 2013, 4:27 AM
Hardik PatelPosted Nov 13, 2013, 2:08 AM
Jaganathan BantheswaranPosted Nov 13, 2013, 1:45 AM
You can use UpdatePanel.
Here is an example