problems with ajax accents on ie

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arty
    New Member
    • Nov 2008
    • 35

    #1

    problems with ajax accents on ie

    i have set up a xhr , all the accents on the page are showed ok on ff an safari
    Code:
    function _cms() {
    cms.open("GET", 'cms.php', true);
    cms.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
    if (cms.overrideMimeType) {
    cms.overrideMimeType('text/html; charset=ISO-8859-1')
             }
    else{cms.setRequestHeader("Content-type", "text/html; charset=ISO-8859-1"); }
    cms.onreadystatechange = function() {
    if(cms.readyState == 1){loader();}
    if(cms.readyState == 4 && cms.status == 200){
    document.getElementById("body_").innerHTML = cms.responseText;
    so i setup a if condition for the overrideMimeTyp e method because ie dont recognize it and blocks the xhr then i set a else with a setRequestHeade r thinking this one would handle the no showing accents on ie (french accents) but it still does not work on ie, any thoughts? regards.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Set the header in the PHP file.

    Comment

    • arty
      New Member
      • Nov 2008
      • 35

      #3
      the called file has the php extension but it's a normal html file so i cant do that

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Try using meta tags to set the content type. Have you tried to load the page directly without Ajax?

        Comment

        • arty
          New Member
          • Nov 2008
          • 35

          #5
          if the page is loaded without ajax the accents are ok, i am calling this page with the AHAH method(response text) so i cannot include a metatag in the called file(only in the calling file wich is the file that calls all the files),it is strange as the overridemymetyp e method works for ff and safari but i cannot find a else statement to make it work for ie

          Comment

          • dmjpro
            Top Contributor
            • Jan 2007
            • 2476

            #6
            Can you show me the error details?
            And what 's exactly happening please tell me :)
            I feared you didn't obtain XML HTTP Request for IE. Show me the code for obtaining XML HTTP Request.

            Comment

            Working...