jquery caching div?
jquery caching div?
Hi, I'm developing a web chat using jquery. I've already done with the user interface but I need to create the admin interface. The main idea is that several users connect to the web chat and the administrador will handle all these requests having an independent window for every session. The admin will have a window in their browser with a lot of jquery ui dialogs which are all chat sessions.
- $(function() {
setInterval("nuevo_chat()",10000);
});
- function nuevo_chat(){
$("#nueva_ventana").load("ventana_chat.php",
{ 'id_hotel': '<?php echo $_REQUEST['id_hotel']; ?>' },
function() {
$(".dialogs").dialog({ width: 520, height: 600,
close: function(event, ui) {
$.ajax({
type: "POST",
url: "termina_sesion.php",
data: {
'id_sesion': $(this).attr('id'),
},
success: function(data){
$('#'+$(this).attr('id')).dialog("close");
}
});
}});
});
}
So what I'm doing is to search for new chat requests and load these into a new dialog window. This is working fine, then the admin needs to close chat window if he/she needs to. I'm using the close event from the dialog ui and deleting from the database the corresponding session (using jquery ajax). The ajax function is performed succesfully and the dialog closes, but then when the function nuevo_chat() is called again it loads the window that was already closed. I can't explain why this is happening since I deleted that record from my database, it seems like jquery is caching this.
How can i prevent this kind of cache?
Thanks
Jorge