瀏覽代碼

Fixed ajax loader for mxl using old mimetype.

Benjamin Giesinger 7 年之前
父節點
當前提交
ae8c5e15af
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/OpenSheetMusicDisplay/AJAX.ts

+ 2 - 1
src/OpenSheetMusicDisplay/AJAX.ts

@@ -11,6 +11,7 @@ export class AJAX {
      */
     public static ajax(url: string): Promise<string> {
         let xhttp: XMLHttpRequest;
+        const mimeType: string = url.indexOf(".mxl") > -1 ? "text/plain; charset=x-user-defined" : "application/xml";
         if (XMLHttpRequest) {
             xhttp = new XMLHttpRequest();
         } else if (ActiveXObject) {
@@ -32,7 +33,7 @@ export class AJAX {
                     }
                 }
             };
-            xhttp.overrideMimeType("text/xml");
+            xhttp.overrideMimeType(mimeType);
             xhttp.open("GET", url, true);
             xhttp.send();
         });