SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy ajax+overrideMimeType problem

    hi, i 'm displaying gbk character in my ajax request.

    HTML Code:
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    if (page_request.overrideMimeType) { 
        page_request.overrideMimeType('text/xml; charset=gbk'); 
    }
    the code above is used.

    It displayed nicely in firefox. However, the characters in IE is not readable... It appears like '????'

    After that, I've tried to remove the code below form the script:
    Code:
    if (page_request.overrideMimeType) { 
        page_request.overrideMimeType('text/xml; charset=gbk');
    Then I added this code (page_request.overrideMimeType("text/html; charset=GBK") here:
    Code:
    if (bustcachevar) //if bust caching of external page
    bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    page_request.open('GET', url+bustcacheparameter, true)
    page_request.overrideMimeType("text/html; charset=GBK");
    page_request.send(null)
    Same, it is ok in Firefox, but in IE, it keep display requestion content... nothing else is displayed. when i click on the next tab, it opens the targeted page in the same window..

    can anyone please help to give some idea to solve this problem?

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •