jquery changing img src dynamically
Hi Every body,
I've a question, in this following script (in WHILE loop), i'm receiving a array (result) containing a image (named process_img) and then I dynamically assigned as follows: $('#process_img').attr('src',result.process_img); While processing I could receive 3 different states (like opened.gif, closing.gif and closed.gif). Everything working fine in Firefox but not in Chrome or even IE.
Could you please help me to find out a solution.
Best regards
Raphy
-
$('#process_img').click(function(){
$.ajax({
url: 'action.php',
type: 'post',
async: false,
dataType:'json',
data:{action:'process'},
success: function(result){
var processing = 1;
var current_status = result.processing_status;
while(processing==1)
{
$.ajax({
url: 'action.php',
type: 'post',
async: false,
cache: false,
dataType:'json',
data:{action:'update', delay:1},
success: function(result){
if(current_status != result.processing_status)
{
current_status = result.processing_status;
setValues(result);
$('#process_img').attr('src',result.process_img);
}
processing = result.processing;
}
});
}
}
});
});