stuttering when using load() and change() happens after next setInterval()
hello,
i have 2 problems.
this is the code:
- setInterval(function(){
- $('#responsecontainer').load('response.php').change();
- }, 30000);
After the load the change() triggers a live event!
The loaded content are some div's with id's and content.
Within the change() trigger i grab the data from those div's
and put them into another div when a certain criteria is accomplished.
The problem is that when the change() trigger grabs the content they are empty untill the next load().
Here the change() trigger:
- $('#responsecontainer').live("change", function(){
- var online_users_box = $("#online_users_box").html(); //this is the div from the load()
-
- if(online_users_box != false){
- $('#pop_cont_online').html(online_users_box); //this is the div on the main page
- }
- });
The second problem is that when i execute the load() in the setInterval() the page stalls until the content is loaded! is there a solution for that or is there a better way to get the same results?
I hope this is enough information to go with!
Greets,
Marc van der Meulen