IE9: XMLHttpRequest Bug - Where to ask to get "real" support

blueshift's picture

I traced down a problem described also at which has the effect, that the textbox "eats" newlines.

It turns out: Echo seems to create XML DOM all correct and everything seems fine. But The content of the inner text node ("<p i=...>text content</p>) gets mangled: Newline characters don't reach the server after passing the XMLHttpRequest object.

Below you'll find a Test page and Servlet to reproduce this problem. I posted a question at but maybe somebody knows a better place to ask how to tackle this?

Here the HTML/JavaScript code which triggers a request. Please note: This HTML page must be deployed on the same server as the target servlet, as XMLHttpRequest is subject to the same-origin policy:

<!DOCTYPE html>
    <title>IE9 Bug Demonstration</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>

<script language="JavaScript">

    MyAjaxClient = {
        createDocument: function(namespaceUri, qualifiedName) {
            // DOM Level 2 Browsers
            var dom;
            dom = document.implementation.createDocument(namespaceUri, qualifiedName, null);
            dom.charset = "utf-8";
            if (!dom.documentElement) {
            return dom;

        connect: function(messageObject) {
            this._xmlHttpRequest = new XMLHttpRequest();

            var instance = this;

            // Create closure around instance.
            this._xmlHttpRequest.onreadystatechange = function() {
                if (!instance) {

  "POST", "../dump", true);

            // Set Content-Type for IE9
            this._xmlHttpRequest.setRequestHeader("Content-Type", "text/xml;charset=utf-8");

            // Execute request.

        _processReadyStateChange : function() {

    function ie9ajaxrequest() {
        var document = MyAjaxClient.createDocument("", "cmsg");
        document.documentElement.setAttribute("t", "init");
        document.documentElement.setAttribute("w", "baz");

        var cSyncElement = document.createElement("dir");
        cSyncElement.setAttribute("proc", "CSync");

        var eElement = document.createElement("e");
        eElement.setAttribute("t", "foo");
        eElement.setAttribute("i", "123");

        var propertyValue = "abc\n123\ndef\nÖzdemir sült Izdemis\n321";
        var pElement = document.createElement("p");
        pElement.setAttribute("i", "123");
        pElement.setAttribute("n", "text");



<h1>Trigger a request</h1>
Press <input type="button" value="Button" onclick="ie9ajaxrequest();"/> to trigger a request.
<p>Özdemir sült Izdemis</p>

Here a small Servlet which dumps simply out all input for convenience

public class RequestDumperServlet extends HttpServlet {
    private static final Log LOG = LogFactory.getLog("SERVLET");

    public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {"");"PARAMETERS:");
        Map<String, String[]> set = req.getParameterMap();
        for (Map.Entry<String, String[]> param : set.entrySet()) {
  "="+ Arrays.toString(param.getValue()));
        Enumeration attributeNames = req.getHeaderNames();
        while (attributeNames.hasMoreElements()) {
            String name = (String) attributeNames.nextElement();
        BufferedReader reader = req.getReader();
        String line;
        while ((line = reader.readLine()) != null) {

The expected output on all Browser is as follows:

<cmsg xmlns="" t="init" w="baz"><dir xmlns="" proc="CSync"><e t="foo" i="123"/><p i="123" n="text">abc
Özdemir sült Izdemis

but in IE9 the server in fact receives the following (Note the leading ? as well as the missing line breaks):

?<cmsg xmlns="" t="init" w="baz"><dir xmlns="" proc="CSync"><e t="foo" i="123" /><p n="text" abc 123 def Özdemir sült Izdemis 321</p></dir></cmsg>

Anybody hints on this issue or where to ask for in-depth information?

Tod got support here

Take a look at this - maybe you can contact the MS Guy?

blueshift's picture

Thanks for the pointer!

Thanks for the pointer! Unfortunately Tod did not post any email so I was unable to extract a contact.
My post on a official IE developer forum on MSDN resulted in the tip to "use <br/> to keep the line breaks" m-)

ralf.e's picture


Finally there was some response on the Microsoft forum...
After pointing some Microsoft related guy from a german forum to this topic and doing some tenaciously questions on the english forum there was an answer!
Yeah - some things take time :-)

See here for the two discussions:

And the thread here on echo3 forum that also fits to that error: