Override mime type, avoid element not found error in updater

This commit is contained in:
Jordan Bates 2013-04-18 11:03:02 -07:00
parent cdff50fc17
commit f0c185c1e7
4 changed files with 6 additions and 2 deletions

View File

@ -351,6 +351,7 @@
}
type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync;
r = new XMLHttpRequest();
r.overrideMimeType('text/html');
type || (type = form && 'post' || 'get');
r.open(type, url, !sync);
for (key in headers) {
@ -4806,7 +4807,7 @@
hashScroll: function() {
var post;
if (!(post = $.id(this.location.hash.slice(1)))) {
if (!(post = this.location.hash.slice(1))) {
return;
}
if ((Get.postFromRoot(post)).isHidden) {

View File

@ -348,6 +348,7 @@
}
type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync;
r = new XMLHttpRequest();
r.overrideMimeType('text/html');
type || (type = form && 'post' || 'get');
r.open(type, url, !sync);
for (key in headers) {

View File

@ -303,6 +303,7 @@
}
type = opts.type, cred = opts.cred, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form, sync = opts.sync;
r = new XMLHttpRequest();
r.overrideMimeType('text/html');
type || (type = form && 'post' || 'get');
r.open(type, url, !sync);
for (key in headers) {
@ -4719,7 +4720,7 @@
hashScroll: function() {
var post;
if (!(post = $.id(this.location.hash.slice(1)))) {
if (!(post = this.location.hash.slice(1))) {
return;
}
if ((Get.postFromRoot(post)).isHidden) {

View File

@ -77,6 +77,7 @@ $.extend $,
ajax: (url, callbacks, opts={}) ->
{type, cred, headers, upCallbacks, form, sync} = opts
r = new XMLHttpRequest()
r.overrideMimeType 'text/html'
type or= form and 'post' or 'get'
r.open type, url, !sync
for key, val of headers