Hello eveyone, Today I have experimented a weird behaviour with Ajax stuff in prototype : Having the JS code above, I retrieve a UTF-8 HTML fragment with special chars like é, à , ù, etc :
var cible = '/lib/ajax/chargementGrille' + ('S' == modeAffichage ? 'Secretaire' : '') + '.php'; new Ajax.Request( cible, { encoding : 'UTF-8', postBody : data, onComplete : function(transport) { try { $('grille').innerHTML = transport.responseText; ... // some additionnal treatment ... } catch(e) { console.log(e); } } } ); My response headers indicate that I receive UTF- 8 text/html data, as expected, but the fact is that the chars are displayed properly until I reach the line $('grille').innerHTML = transport.responseText;. Then they are replaced with é", "î", ... It's clearly shown by executing the JS code line by line with Firebug. If I delete this line, everything is OK, but how the hell Javascript knows that I want this portin of HTLM code replaced by the one received byh AJAX ? The same thing happens directly with an Ajax.Updater function, without any onComplete block.... Please help, I've spent so many time to find out the trick.... Thanks in advance, Jérémie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---