When a string inside a div changes do something
Moderator: General Moderators
Re: When a string inside a div changes do something
what's the content of the setInterval callback...
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: When a string inside a div changes do something
I don't really know what to put in the function.
Re: When a string inside a div changes do something
It should be something like this:
Code: Select all
//Set the start value (could be empty)
var title = document.getElementById('cc_stream_info_song').innerHTML;
function check() {
var currentTitle = document.getElementById('cc_stream_info_song').innerHTML;
if(title != currentTitle) {
//get artist information
title = currentTitle; //Update the variable to the current content
}
}
setInterval(check, 10000);
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: When a string inside a div changes do something
Aaaaaaaa much much more simpler then thought.
Thnx again
.
Thnx again
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: When a string inside a div changes do something
I tried it and worked perfectly.